Lines Matching refs:std
53 extern std::string SUPPORT_LIBRARY_NAME;
72 Result* result, std::vector<TestBuffer>* outputs);
74 std::optional<Compilation> compileModel(const Model& model, ANeuralNetworksDevice* device);
85 std::string mCacheDir;
86 std::vector<uint8_t> mToken;
94 std::unique_ptr<const NnApiSupportLibrary> mNnApi =
127 std::array<bool, MAX_NUM_OPS> supportedOps; in checkSupported()
135 std::all_of(supportedOps.begin(), supportedOps.end(), [](bool v) { return v; }); in checkSupported()
139 static std::vector<base::unique_fd> createCacheFds(const std::vector<std::string>& files) { in createCacheFds()
140 std::vector<base::unique_fd> fds; in createCacheFds()
148 fds.push_back(std::move(fd)); in createCacheFds()
153 std::optional<Compilation> GeneratedTests::compileModel(const Model& model, in compileModel()
163 std::string mode = ::android::base::GetProperty("debug.nn.slts.caching", "random"); in compileModel()
170 std::string testName = ::testing::UnitTest::GetInstance()->current_test_info()->name(); in compileModel()
171 std::seed_seq seq(testName.begin(), testName.end()); in compileModel()
172 std::mt19937 gen(seq); in compileModel()
173 std::bernoulli_distribution d(0.5); in compileModel()
183 SCOPED_TRACE("Use setCachingFromFds = " + std::to_string(useSetCachingFromFds) + " (" + in compileModel()
185 std::cout << "\nUse setCachingFromFds = " << std::boolalpha << useSetCachingFromFds << " (" in compileModel()
186 << mode << ")" << std::endl; in compileModel()
188 std::vector<std::string> modelCacheFilenames, dataCacheFilenames; in compileModel()
195 modelCacheFilenames.push_back({mCacheDir + "/model" + std::to_string(i)}); in compileModel()
198 dataCacheFilenames.push_back({mCacheDir + "/data" + std::to_string(i)}); in compileModel()
204 auto compilation1 = std::move(resultCompilation1.second); in compileModel()
217 auto compilation2 = std::move(resultCompilation2.second); in compileModel()
232 auto compilation = std::move(resultCompilation.second); in compileModel()
238 if (mExpectFailure && result != Result::NO_ERROR) return std::nullopt; in compileModel()
246 std::vector<TestBuffer>* outputs) { in computeWithPtrs()
286 std::vector<TestBuffer>* outputs) { in computeWithDeviceMemories()
291 std::vector<Memory> inputMemories, outputMemories; in computeWithDeviceMemories()
297 SCOPED_TRACE("Input index: " + std::to_string(i)); in computeWithDeviceMemories()
320 SCOPED_TRACE("Output index: " + std::to_string(i)); in computeWithDeviceMemories()
332 SCOPED_TRACE("Output index: " + std::to_string(i)); in computeWithDeviceMemories()
341 std::copy(ashmem->dataAs<uint8_t>(), ashmem->dataAs<uint8_t>() + bufferSize, in computeWithDeviceMemories()
352 std::vector<TestBuffer> outputs; in executeWithCompilation()
376 SCOPED_TRACE("Output index: " + std::to_string(i)); in executeWithCompilation()
379 std::vector<uint32_t> actualDimensions; in executeWithCompilation()
398 SCOPED_TRACE("Device = " + std::string(deviceName)); in executeOnce()
399 std::cout << "\nDevice = " << deviceName << std::endl; in executeOnce()
401 std::cout << "\nModel not supported by device " << deviceName << ". Skipping" in executeOnce()
402 << std::endl; in executeOnce()
406 std::cout << "\nModel supported" << std::endl; in executeOnce()
407 std::optional<Compilation> compilation = compileModel(model, device); in executeOnce()
412 std::cout << "\nExecution completed" << std::endl; in executeOnce()
415 std::cout << "\nModel not supported by any device\n" in executeOnce()
416 << "SKIPPED" << std::endl; in executeOnce()
424 std::cout << "\nMultithreadedOwnCompilation" << std::endl; in executeMultithreadedOwnCompilation()
425 std::vector<std::thread> threads; in executeMultithreadedOwnCompilation()
427 threads.push_back(std::thread([&]() { executeOnce(model, testModel); })); in executeMultithreadedOwnCompilation()
429 std::for_each(threads.begin(), threads.end(), [](std::thread& t) { t.join(); }); in executeMultithreadedOwnCompilation()
436 std::cout << "\nMultithreadedSharedCompilation" << std::endl; in executeMultithreadedSharedCompilation()
445 SCOPED_TRACE("Device = " + std::string(deviceName)); in executeMultithreadedSharedCompilation()
446 std::cout << "\nDevice = " << deviceName << std::endl; in executeMultithreadedSharedCompilation()
448 std::cout << "\nModel not supported by device " << deviceName << ". Skipping" in executeMultithreadedSharedCompilation()
449 << std::endl; in executeMultithreadedSharedCompilation()
453 std::cout << "\nModel supported" << std::endl; in executeMultithreadedSharedCompilation()
454 std::optional<Compilation> compilation = compileModel(model, device); in executeMultithreadedSharedCompilation()
458 std::vector<std::thread> threads; in executeMultithreadedSharedCompilation()
461 std::thread([&]() { executeWithCompilation(compilation.value(), testModel); })); in executeMultithreadedSharedCompilation()
463 std::for_each(threads.begin(), threads.end(), [](std::thread& t) { t.join(); }); in executeMultithreadedSharedCompilation()
464 std::cout << "\nExecution completed" << std::endl; in executeMultithreadedSharedCompilation()
467 std::cout << "\nModel not supported by any device\n" in executeMultithreadedSharedCompilation()
468 << "SKIPPED" << std::endl; in executeMultithreadedSharedCompilation()
483 SCOPED_TRACE("TestCompilationCaching = " + std::to_string(mTestCompilationCaching)); in execute()
484 std::cout << "\nCompilationCaching = " << std::boolalpha << mTestCompilationCaching in execute()
485 << std::endl; in execute()
505 static const std::map<int, std::set<std::string>> kMapOfMinVndkVersionToTests = { in shouldSkipTest()
534 mToken = std::vector<uint8_t>(ANEURALNETWORKS_BYTE_SIZE_OF_CACHE_TOKEN, 0); in SetUp()
553 std::cout << "\nComputeMode = SYNC" << std::endl; in TEST_P()
559 std::cout << "\nComputeMode = BURST" << std::endl; in TEST_P()
608 std::all_of(testModel.main.outputIndexes.begin(), testModel.main.outputIndexes.end(), in __anonc55b0d030e02()
616 std::all_of(testModel.main.outputIndexes.begin(), testModel.main.outputIndexes.end(), in __anonc55b0d031002()