/packages/modules/NeuralNetworks/runtime/test/ |
D | TestGenerated.cpp | 69 void executeInternal(const Compilation& compilation, const TestModel& testModel, 71 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel); 140 Compilation compilation(&model); in compileModel() local 141 Result result = compilation.finish(); in compileModel() 148 return compilation; in compileModel() 152 static ANeuralNetworksMemory* createDeviceMemoryForInput(const Compilation& compilation, in createDeviceMemoryForInput() argument 156 EXPECT_EQ(ANeuralNetworksMemoryDesc_addInputRole(desc, compilation.getHandle(), index, 1.0f), in createDeviceMemoryForInput() 165 static ANeuralNetworksMemory* createDeviceMemoryForOutput(const Compilation& compilation, in createDeviceMemoryForOutput() argument 169 EXPECT_EQ(ANeuralNetworksMemoryDesc_addOutputRole(desc, compilation.getHandle(), index, 1.0f), in createDeviceMemoryForOutput() 178 static void createRequestWithDeviceMemories(const Compilation& compilation, in createRequestWithDeviceMemories() argument [all …]
|
D | TestFree.cpp | 91 ANeuralNetworksCompilation* compilation = nullptr; in TEST() local 92 ASSERT_EQ(ANeuralNetworksCompilation_create(model, &compilation), ANEURALNETWORKS_NO_ERROR); in TEST() 93 ANeuralNetworksCompilation_free(compilation); in TEST() 103 ANeuralNetworksCompilation* compilation = nullptr; in TEST() local 105 &compilation), in TEST() 107 ANeuralNetworksCompilation_free(compilation); in TEST() 115 ANeuralNetworksCompilation* compilation = nullptr; in TEST() local 116 ASSERT_EQ(ANeuralNetworksCompilation_create(model, &compilation), ANEURALNETWORKS_NO_ERROR); in TEST() 117 ASSERT_EQ(ANeuralNetworksCompilation_finish(compilation), ANEURALNETWORKS_NO_ERROR); in TEST() 120 ASSERT_EQ(ANeuralNetworksExecution_create(compilation, &execution), ANEURALNETWORKS_NO_ERROR); in TEST() [all …]
|
D | TestMemoryDomain.cpp | 193 test_wrapper::Compilation compilation; in createCompilation() local 210 std::tie(result, compilation) = in createCompilation() 214 compilation = test_wrapper::Compilation(&mModel); in createCompilation() 216 EXPECT_EQ(compilation.finish(), WrapperResult::NO_ERROR); in createCompilation() 217 return compilation; in createCompilation() 221 const test_wrapper::Compilation& compilation, const std::vector<uint32_t>& inputIndexes, in allocateDeviceMemory() argument 223 const auto* annCompilation = compilation.getHandle(); in allocateDeviceMemory() 295 auto compilation = createCompilation({"test_driver"}); in TEST_P() local 296 ASSERT_NE(compilation.getHandle(), nullptr); in TEST_P() 298 auto [n, memory] = allocateDeviceMemory(compilation, {0}, {0}); in TEST_P() [all …]
|
D | TestTrivialModel.cpp | 119 Compilation compilation(&modelAdd2); in TEST_F() local 120 compilation.finish(); in TEST_F() 121 Execution execution(&compilation); in TEST_F() 156 Compilation compilation(&modelAdd2); in testAddTwoWithHardwareBufferInput() local 157 compilation.finish(); in testAddTwoWithHardwareBufferInput() 158 Execution execution(&compilation); in testAddTwoWithHardwareBufferInput() 232 Compilation compilation(&modelAdd3); in TEST_F() local 233 compilation.finish(); in TEST_F() 240 Execution execution1(&compilation); in TEST_F() 251 Execution execution2(&compilation); in TEST_F() [all …]
|
D | SupportLibraryTestGenerated.cpp | 66 ANeuralNetworksMemory* createDeviceMemoryForInput(const Compilation& compilation, 68 ANeuralNetworksMemory* createDeviceMemoryForOutput(const Compilation& compilation, 70 void computeWithDeviceMemories(const Compilation& compilation, const TestModel& testModel, 75 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel); 232 auto compilation = std::move(resultCompilation.second); in compileModel() local 233 Result result = compilation.finish(); in compileModel() 240 return compilation; in compileModel() 254 ANeuralNetworksMemory* GeneratedTests::createDeviceMemoryForInput(const Compilation& compilation, in createDeviceMemoryForInput() argument 258 EXPECT_EQ(mNnApi->ANeuralNetworksMemoryDesc_addInputRole(desc, compilation.getHandle(), index, in createDeviceMemoryForInput() 268 ANeuralNetworksMemory* GeneratedTests::createDeviceMemoryForOutput(const Compilation& compilation, in createDeviceMemoryForOutput() argument [all …]
|
D | TestFailingDriver.cpp | 144 WrapperCompilation compilation(&model); in TEST_F() local 145 ASSERT_EQ(compilation.finish(), Result::NO_ERROR); in TEST_F() 148 reinterpret_cast<CompilationBuilder*>(compilation.getHandle()); in TEST_F() 162 WrapperExecution execution(&compilation); in TEST_F() 194 WrapperCompilation compilation(&model); in TEST_F() local 195 ASSERT_EQ(compilation.finish(), Result::NO_ERROR); in TEST_F() 198 reinterpret_cast<CompilationBuilder*>(compilation.getHandle()); in TEST_F() 202 WrapperExecution execution(&compilation); in TEST_F()
|
D | TestValidation.cpp | 354 void executeWithMemoryAsInput(ANeuralNetworksCompilation* compilation, in executeWithMemoryAsInput() argument 358 ASSERT_EQ(ANeuralNetworksExecution_create(compilation, &execution), in executeWithMemoryAsInput() 368 void executeWithMemoryAsOutput(ANeuralNetworksCompilation* compilation, in executeWithMemoryAsOutput() argument 372 ASSERT_EQ(ANeuralNetworksExecution_create(compilation, &execution), in executeWithMemoryAsOutput() 861 ANeuralNetworksCompilation* compilation = nullptr; in TEST_F() local 862 EXPECT_EQ(ANeuralNetworksCompilation_create(nullptr, &compilation), in TEST_F() 865 EXPECT_EQ(ANeuralNetworksCompilation_create(mModel, &compilation), ANEURALNETWORKS_BAD_STATE); in TEST_F() 876 ANeuralNetworksCompilation* compilation = nullptr; in TEST_F() local 877 EXPECT_EQ(ANeuralNetworksCompilation_createForDevices(nullptr, &device, 1, &compilation), in TEST_F() 883 EXPECT_EQ(ANeuralNetworksCompilation_createForDevices(mModel, &device, 0, &compilation), in TEST_F() [all …]
|
D | TestNeuralNetworksWrapper.h | 258 ANeuralNetworksCompilation* compilation = nullptr; in createForDevices() local 261 &compilation)); in createForDevices() 262 return {result, Compilation(compilation)}; in createForDevices() 359 Compilation(ANeuralNetworksCompilation* compilation) : mCompilation(compilation) {} in Compilation() argument 366 Execution(const Compilation* compilation) : mCompilation(compilation->getHandle()) { in Execution() argument 367 int result = ANeuralNetworksExecution_create(compilation->getHandle(), &mExecution); in Execution()
|
D | TestControlFlow.cpp | 90 Compilation compilation(&model); in TEST_F() local 91 ASSERT_EQ(compilation.finish(), Result::NO_ERROR); in TEST_F() 95 Execution execution(&compilation); in TEST_F()
|
/packages/modules/NeuralNetworks/shim_and_sl/public/ |
D | NeuralNetworksSupportLibraryImpl.h | 150 int SL_ANeuralNetworksCompilation_setCachingFromFds(ANeuralNetworksCompilation* compilation, 312 int (*ANeuralNetworksBurst_create)(ANeuralNetworksCompilation* compilation, 332 ANeuralNetworksCompilation** compilation); 340 int (*ANeuralNetworksCompilation_finish)(ANeuralNetworksCompilation* compilation); 348 void (*ANeuralNetworksCompilation_free)(ANeuralNetworksCompilation* compilation); 358 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment); 368 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment); 378 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding); 388 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding); 396 int (*ANeuralNetworksCompilation_setCaching)(ANeuralNetworksCompilation* compilation, [all …]
|
/packages/modules/NeuralNetworks/runtime/include/ |
D | NeuralNetworks.h | 148 const ANeuralNetworksCompilation* compilation, 195 const ANeuralNetworksCompilation* compilation, 526 ANeuralNetworksCompilation** compilation) 554 int ANeuralNetworksCompilation_setCaching(ANeuralNetworksCompilation* compilation, 666 int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, 1225 ANeuralNetworksCompilation** compilation) 1241 void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation* compilation) 1261 int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation* compilation, 1287 int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) 1313 int ANeuralNetworksCompilation_setPriority(ANeuralNetworksCompilation* compilation, int priority) [all …]
|
D | NeuralNetworksWrapper.h | 461 ANeuralNetworksCompilation* compilation = nullptr; local 465 devices.size(), &compilation)); 466 return {result, Compilation(nnapi, compilation)}; 566 Compilation(const NnApiSupportLibrary* nnapi, ANeuralNetworksCompilation* compilation) argument 567 : mNnApi(nnapi), mCompilation(compilation) {} 580 Execution(const NnApiSupportLibrary* nnapi, const Compilation* compilation) : mNnApi(nnapi) { argument 582 Execution(const Compilation* compilation) { 585 NNAPI_CALL(ANeuralNetworksExecution_create(compilation->getHandle(), &mExecution));
|
/packages/modules/NeuralNetworks/runtime/ |
D | NeuralNetworks.cpp | 778 ANeuralNetworksCompilation** compilation) { in ANeuralNetworksCompilation_createForDevices() argument 780 if (model == nullptr || devices == nullptr || compilation == nullptr) { in ANeuralNetworksCompilation_createForDevices() 821 *compilation = reinterpret_cast<ANeuralNetworksCompilation*>(c); in ANeuralNetworksCompilation_createForDevices() 869 int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, in ANeuralNetworksBurst_create() argument 872 if (!compilation || !burst) { in ANeuralNetworksBurst_create() 877 CompilationBuilder* c = reinterpret_cast<CompilationBuilder*>(compilation); in ANeuralNetworksBurst_create() 944 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addInputRole() argument 947 if (!desc || !compilation) { in ANeuralNetworksMemoryDesc_addInputRole() 952 const CompilationBuilder* c = reinterpret_cast<const CompilationBuilder*>(compilation); in ANeuralNetworksMemoryDesc_addInputRole() 957 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addOutputRole() argument [all …]
|
D | Memory.cpp | 74 bool validate(const CompilationBuilder* compilation, IOType, uint32_t, in validate() argument 77 NN_RET_CHECK(compilation != nullptr) in validate() 101 bool validate(const CompilationBuilder* compilation, IOType ioType, uint32_t index, in validate() argument 104 NN_RET_CHECK(kCompilationRoles.count({compilation, ioType, index}) > 0) in validate() 309 int MemoryBuilder::addRole(const CompilationBuilder& compilation, IOType ioType, uint32_t index, in addRole() argument 315 if (mRoles.count({&compilation, ioType, index}) > 0) { in addRole() 326 if (compilation.forEachStepRoleOfInput(index, callback) != ANEURALNETWORKS_NO_ERROR) { in addRole() 330 if (compilation.forEachStepRoleOfOutput(index, callback) != ANEURALNETWORKS_NO_ERROR) { in addRole() 335 const ModelBuilder* model = compilation.getModel(); in addRole() 375 mRoles.emplace(&compilation, ioType, index); in addRole()
|
D | BurstBuilder.cpp | 32 BurstBuilder::BurstBuilder(const CompilationBuilder* compilation, in BurstBuilder() argument 34 : mCompilation(compilation), mBurstControllers(std::move(burstControllers)) {} in BurstBuilder()
|
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/ |
D | FuzzTest.cpp | 96 Compilation compilation(&model); in CreateCompilation() local 97 if (compilation.finish() != Result::NO_ERROR) { in CreateCompilation() 100 return compilation; in CreateCompilation() 103 std::optional<Execution> CreateExecution(const Compilation& compilation, in CreateExecution() argument 105 Execution execution(&compilation); in CreateExecution() 138 auto compilation = CreateCompilation(*model); in nnapiFuzzTest() local 139 if (!compilation.has_value()) { in nnapiFuzzTest() 144 auto execution = CreateExecution(*compilation, testModel); in nnapiFuzzTest()
|
/packages/modules/NeuralNetworks/tools/api/ |
D | NeuralNetworksTypes.t | 339 * {@link ANeuralNetworksModel_setOperandValueFromMemory}, any compilation 341 * using such a compilation, or any execution which references this memory 382 * This includes any compilation, execution object or burst object created using 394 * <li>Create a new compilation instance by calling the 397 * <li>Set any desired properties on the compilation (for example, 400 * compilation by calling {@link ANeuralNetworksCompilation_setCaching}.</li> 401 * <li>Complete the compilation with {@link ANeuralNetworksCompilation_finish}.</li> 402 * <li>Use the compilation as many times as needed 405 * <li>Destroy the compilation with {@link ANeuralNetworksCompilation_free} 406 * once all executions using the compilation have completed.</li></ul></p> [all …]
|
/packages/modules/NeuralNetworks/shim_and_sl/ |
D | ShimDevice.cpp | 561 auto compilation = ::android::nn::sl_wrapper::Compilation::createForDevice( in prepareModel() local 564 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.first, callback); in prepareModel() 565 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.setPreference(*ndkPreference), in prepareModel() 567 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.setPriority(*ndkPriority), in prepareModel() 579 compilation.second.setTimeout(std::max<uint64_t>(1, timeoutDuration.count())), in prepareModel() 584 compilation.second.setCachingFromFds(getIntFds(modelCache), getIntFds(dataCache), in prepareModel() 588 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.finish(), callback); in prepareModel() 592 mNnapi, mBufferTracker, std::move(compilation.second), in prepareModel()
|
/packages/modules/NeuralNetworks/shim_and_sl/include/ |
D | SupportLibraryWrapper.h | 357 ANeuralNetworksCompilation* compilation = nullptr; in createForDevices() local 361 devices.size(), &compilation)); in createForDevices() 362 return {result, Compilation(nnapi, compilation)}; in createForDevices() 466 Compilation(const NnApiSupportLibrary* nnapi, ANeuralNetworksCompilation* compilation) in Compilation() argument 467 : mNnApi(nnapi), mCompilation(compilation) {} in Compilation() 475 Execution(const NnApiSupportLibrary* nnapi, const Compilation* compilation) in Execution() argument 476 : mNnApi(nnapi), mCompilation(compilation->getHandle()) { in Execution() 477 int result = mNnApi->ANeuralNetworksExecution_create(compilation->getHandle(), &mExecution); in Execution()
|
/packages/modules/NeuralNetworks/runtime/test/fuzzing/ |
D | TestRandomGraph.cpp | 255 auto [result, compilation] = test_wrapper::Compilation::createForDevice(&model, refDevice); in computeGoldenResults() 257 ASSERT_EQ(compilation.finish(), Result::NO_ERROR); in computeGoldenResults() 260 test_wrapper::Execution execution(&compilation); in computeGoldenResults() 307 auto [result, compilation] = test_wrapper::Compilation::createForDevice(model, device); in computeAndVerifyResultsForDevice() 309 Result compileReturn = compilation.finish(); in computeAndVerifyResultsForDevice() 320 test_wrapper::Execution execution(&compilation); in computeAndVerifyResultsForDevice() 352 test_wrapper::Compilation compilation(model); in computeAndVerifyResults() local 353 ASSERT_EQ(compilation.finish(), Result::NO_ERROR); in computeAndVerifyResults() 356 test_wrapper::Execution execution(&compilation); in computeAndVerifyResults()
|
/packages/modules/NeuralNetworks/common/operations/ |
D | MultinomialTest.cpp | 61 Compilation compilation(&model_); in Invoke() local 62 compilation.finish(); in Invoke() 63 Execution execution(&compilation); in Invoke()
|
D | EmbeddingLookupTest.cpp | 97 Compilation compilation(&model_); in Invoke() local 98 compilation.finish(); in Invoke() 99 Execution execution(&compilation); in Invoke()
|
D | LSHProjectionTest.cpp | 101 Compilation compilation(&model_); in Invoke() local 102 compilation.finish(); in Invoke() 103 Execution execution(&compilation); in Invoke()
|
D | HashtableLookupTest.cpp | 112 Compilation compilation(&model_); in Invoke() local 113 compilation.finish(); in Invoke() 114 Execution execution(&compilation); in Invoke()
|
D | RNNTest.cpp | 197 Compilation compilation(&model_); in Invoke() local 198 compilation.finish(); in Invoke() 199 Execution execution(&compilation); in Invoke()
|