/packages/modules/NeuralNetworks/runtime/test/ |
D | TestGenerated.cpp | 72 void executeInternal(const Compilation& compilation, const TestModel& testModel, 74 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel); 143 Compilation compilation(&model); in compileModel() local 144 Result result = compilation.finish(); in compileModel() 151 return compilation; in compileModel() 155 static ANeuralNetworksMemory* createDeviceMemoryForInput(const Compilation& compilation, in createDeviceMemoryForInput() argument 159 EXPECT_EQ(ANeuralNetworksMemoryDesc_addInputRole(desc, compilation.getHandle(), index, 1.0f), in createDeviceMemoryForInput() 168 static ANeuralNetworksMemory* createDeviceMemoryForOutput(const Compilation& compilation, in createDeviceMemoryForOutput() argument 172 EXPECT_EQ(ANeuralNetworksMemoryDesc_addOutputRole(desc, compilation.getHandle(), index, 1.0f), in createDeviceMemoryForOutput() 181 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 | 200 test_wrapper::Compilation compilation; in createCompilation() local 217 std::tie(result, compilation) = in createCompilation() 221 compilation = test_wrapper::Compilation(&mModel); in createCompilation() 223 EXPECT_EQ(compilation.finish(), WrapperResult::NO_ERROR); in createCompilation() 224 return compilation; in createCompilation() 228 const test_wrapper::Compilation& compilation, const std::vector<uint32_t>& inputIndexes, in allocateDeviceMemory() argument 230 const auto* annCompilation = compilation.getHandle(); in allocateDeviceMemory() 298 auto compilation = createCompilation({"test_driver"}); in TEST_P() local 299 ASSERT_NE(compilation.getHandle(), nullptr); in TEST_P() 301 auto [n, memory] = allocateDeviceMemory(compilation, {0}, {0}); in TEST_P() [all …]
|
D | TestTrivialModel.cpp | 124 Compilation compilation(&modelAdd2); in TEST_F() local 125 compilation.finish(); in TEST_F() 126 Execution execution(&compilation); in TEST_F() 166 Compilation compilation(&modelAdd2); in testAddTwoWithHardwareBufferInput() local 167 compilation.finish(); in testAddTwoWithHardwareBufferInput() 168 Execution execution(&compilation); in testAddTwoWithHardwareBufferInput() 244 Compilation compilation(&modelAdd3); in TEST_F() local 245 compilation.finish(); in TEST_F() 252 Execution execution1(&compilation); in TEST_F() 263 Execution execution2(&compilation); in TEST_F() [all …]
|
D | SupportLibraryTestGenerated.cpp | 76 ANeuralNetworksMemory* createDeviceMemoryForInput(const Compilation& compilation, 78 ANeuralNetworksMemory* createDeviceMemoryForOutput(const Compilation& compilation, 81 const Compilation& compilation, const TestModel& testModel, Execution* execution, 85 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel); 241 auto compilation = std::move(resultCompilation.second); in compileModel() local 242 Result result = compilation.finish(); in compileModel() 249 return compilation; in compileModel() 263 ANeuralNetworksMemory* GeneratedTests::createDeviceMemoryForInput(const Compilation& compilation, in createDeviceMemoryForInput() argument 268 desc, compilation.getHandle(), index, 1.0f), in createDeviceMemoryForInput() 277 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 | TestNeuralNetworksWrapper.h | 260 ANeuralNetworksCompilation* compilation = nullptr; in createForDevices() local 263 &compilation)); in createForDevices() 264 return {result, Compilation(compilation)}; in createForDevices() 361 Compilation(ANeuralNetworksCompilation* compilation) : mCompilation(compilation) {} in Compilation() argument 368 Execution(const Compilation* compilation) : mCompilation(compilation->getHandle()) { in Execution() argument 369 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()
|
D | TestValidation.cpp | 368 void executeWithMemoryAsInput(ANeuralNetworksCompilation* compilation, in executeWithMemoryAsInput() argument 372 ASSERT_EQ(ANeuralNetworksExecution_create(compilation, &execution), in executeWithMemoryAsInput() 382 void executeWithMemoryAsOutput(ANeuralNetworksCompilation* compilation, in executeWithMemoryAsOutput() argument 386 ASSERT_EQ(ANeuralNetworksExecution_create(compilation, &execution), in executeWithMemoryAsOutput() 883 ANeuralNetworksCompilation* compilation = nullptr; in TEST_F() local 884 EXPECT_EQ(ANeuralNetworksCompilation_create(nullptr, &compilation), in TEST_F() 887 EXPECT_EQ(ANeuralNetworksCompilation_create(mModel, &compilation), ANEURALNETWORKS_BAD_STATE); in TEST_F() 898 ANeuralNetworksCompilation* compilation = nullptr; in TEST_F() local 899 EXPECT_EQ(ANeuralNetworksCompilation_createForDevices(nullptr, &device, 1, &compilation), in TEST_F() 905 EXPECT_EQ(ANeuralNetworksCompilation_createForDevices(mModel, &device, 0, &compilation), in TEST_F() [all …]
|
D | TestTelemetry.cpp | 65 Compilation compilation(&modelAdd2); in TEST_F() local 66 compilation.finish(); in TEST_F() 67 Execution execution(&compilation); in TEST_F()
|
/packages/modules/NeuralNetworks/runtime/include/ |
D | NeuralNetworks.h | 169 const ANeuralNetworksCompilation* compilation, 219 const ANeuralNetworksCompilation* compilation, 596 ANeuralNetworksCompilation** compilation) 627 int ANeuralNetworksCompilation_setCaching(ANeuralNetworksCompilation* compilation, 752 int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, 1380 ANeuralNetworksCompilation** compilation) 1399 void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation* compilation) 1422 int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation* compilation, 1452 int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) 1481 int ANeuralNetworksCompilation_setPriority(ANeuralNetworksCompilation* compilation, int priority) [all …]
|
D | NeuralNetworksWrapper.h | 474 ANeuralNetworksCompilation* compilation = nullptr; local 478 devices.size(), &compilation)); 479 return {result, Compilation(nnapi, compilation)}; 579 Compilation(const NnApiSupportLibrary* nnapi, ANeuralNetworksCompilation* compilation) argument 580 : mNnApi(nnapi), mCompilation(compilation) {} 593 Execution(const NnApiSupportLibrary* nnapi, const Compilation* compilation) : mNnApi(nnapi) { argument 595 Execution(const Compilation* compilation) { 598 NNAPI_CALL(ANeuralNetworksExecution_create(compilation->getHandle(), &mExecution));
|
/packages/modules/NeuralNetworks/shim_and_sl/public/ |
D | NeuralNetworksSupportLibraryImpl.h | 150 int SL_ANeuralNetworksCompilation_setCachingFromFds(ANeuralNetworksCompilation* compilation, 636 int (*ANeuralNetworksBurst_create)(ANeuralNetworksCompilation* compilation, 656 ANeuralNetworksCompilation** compilation); 664 int (*ANeuralNetworksCompilation_finish)(ANeuralNetworksCompilation* compilation); 672 void (*ANeuralNetworksCompilation_free)(ANeuralNetworksCompilation* compilation); 682 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment); 692 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* alignment); 702 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding); 712 const ANeuralNetworksCompilation* compilation, uint32_t index, uint32_t* padding); 720 int (*ANeuralNetworksCompilation_setCaching)(ANeuralNetworksCompilation* compilation, [all …]
|
/packages/modules/NeuralNetworks/runtime/ |
D | NeuralNetworks.cpp | 818 ANeuralNetworksCompilation** compilation) { in ANeuralNetworksCompilation_createForDevices() argument 820 if (model == nullptr || devices == nullptr || compilation == nullptr) { in ANeuralNetworksCompilation_createForDevices() 861 *compilation = reinterpret_cast<ANeuralNetworksCompilation*>(c); in ANeuralNetworksCompilation_createForDevices() 909 int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, in ANeuralNetworksBurst_create() argument 912 if (!compilation || !burst) { in ANeuralNetworksBurst_create() 917 CompilationBuilder* c = reinterpret_cast<CompilationBuilder*>(compilation); in ANeuralNetworksBurst_create() 984 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addInputRole() argument 987 if (!desc || !compilation) { in ANeuralNetworksMemoryDesc_addInputRole() 992 const CompilationBuilder* c = reinterpret_cast<const CompilationBuilder*>(compilation); in ANeuralNetworksMemoryDesc_addInputRole() 997 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addOutputRole() argument [all …]
|
D | Telemetry.cpp | 203 auto compilation = e->getCompilation(); in onExecutionFinish() local 221 .deviceId = makeDeviceId(compilation->getDevices()), in onExecutionFinish() 229 .introspectionEnabled = compilation->createdWithExplicitDeviceList(), in onExecutionFinish() 230 .cacheEnabled = compilation->isCacheInfoProvided(), in onExecutionFinish() 231 .hasControlFlow = compilation->getModel()->hasControlFlow(), in onExecutionFinish() 232 .hasDynamicTemporaries = compilation->hasDynamicTemporaries(), in onExecutionFinish() 246 void registerTelemetryCallbacks(std::function<void(const DiagnosticCompilationInfo*)> compilation, in registerTelemetryCallbacks() argument 248 gCompilationCallback = std::move(compilation); in registerTelemetryCallbacks()
|
D | NeuralNetworksV2.cpp | 887 int ANeuralNetworksBurst_create(ANeuralNetworksCompilation* compilation, in ANeuralNetworksBurst_create() argument 890 if (!compilation || !burst) { in ANeuralNetworksBurst_create() 895 CompilationBuilder* c = reinterpret_cast<CompilationBuilder*>(compilation); in ANeuralNetworksBurst_create() 939 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addInputRole() argument 942 if (!desc || !compilation) { in ANeuralNetworksMemoryDesc_addInputRole() 947 const CompilationBuilder* c = reinterpret_cast<const CompilationBuilder*>(compilation); in ANeuralNetworksMemoryDesc_addInputRole() 952 const ANeuralNetworksCompilation* compilation, in ANeuralNetworksMemoryDesc_addOutputRole() argument 955 if (!desc || !compilation) { in ANeuralNetworksMemoryDesc_addOutputRole() 960 const CompilationBuilder* c = reinterpret_cast<const CompilationBuilder*>(compilation); in ANeuralNetworksMemoryDesc_addOutputRole() 1200 ANeuralNetworksCompilation** compilation) { in ANeuralNetworksCompilation_create() argument [all …]
|
D | Memory.cpp | 78 bool validate(const CompilationBuilder* compilation, IOType, uint32_t, in validate() argument 81 NN_RET_CHECK(compilation != nullptr) in validate() 105 bool validate(const CompilationBuilder* compilation, IOType ioType, uint32_t index, in validate() argument 108 NN_RET_CHECK(kCompilationRoles.count({compilation, ioType, index}) > 0) in validate() 317 int MemoryBuilder::addRole(const CompilationBuilder& compilation, IOType ioType, uint32_t index, in addRole() argument 323 if (mRoles.count({&compilation, ioType, index}) > 0) { in addRole() 334 if (compilation.forEachStepRoleOfInput(index, callback) != ANEURALNETWORKS_NO_ERROR) { in addRole() 338 if (compilation.forEachStepRoleOfOutput(index, callback) != ANEURALNETWORKS_NO_ERROR) { in addRole() 343 const ModelBuilder* model = compilation.getModel(); in addRole() 383 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 | 158 Compilation compilation(&model); in CreateCompilation() local 159 if (compilation.finish() != Result::NO_ERROR) { in CreateCompilation() 162 return compilation; in CreateCompilation() 165 std::optional<Execution> CreateExecution(const Compilation& compilation, in CreateExecution() argument 167 Execution execution(&compilation); in CreateExecution() 200 auto compilation = CreateCompilation(models->front()); in nnapiFuzzTest() local 201 if (!compilation.has_value()) { in nnapiFuzzTest() 206 auto execution = CreateExecution(*compilation, testModel); in nnapiFuzzTest()
|
/packages/modules/NeuralNetworks/shim_and_sl/ |
D | ShimDevice.cpp | 563 auto compilation = ::android::nn::sl_wrapper::Compilation::createForDevice( in prepareModelCommon() local 566 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.first, callback); in prepareModelCommon() 567 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.setPreference(*ndkPreference), in prepareModelCommon() 569 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.setPriority(*ndkPriority), in prepareModelCommon() 581 compilation.second.setTimeout(std::max<uint64_t>(1, timeoutDuration.count())), in prepareModelCommon() 586 compilation.second.setCachingFromFds(getIntFds(modelCache), getIntFds(dataCache), in prepareModelCommon() 609 compilation.second.addExtensionAttribute(extensionName, in prepareModelCommon() 615 SLW2SAS_OK_RETURN_AND_ERROR_CALLBACK_IF_ERROR(compilation.second.finish(), callback); in prepareModelCommon() 619 mNnapi, mBufferTracker, std::move(compilation.second), in prepareModelCommon()
|
/packages/modules/NeuralNetworks/tools/api/ |
D | NeuralNetworksTypes.t | 356 * {@link ANeuralNetworksModel_setOperandValueFromMemory}, any compilation 358 * using such a compilation, or any execution which references this memory 399 * This includes any compilation, execution object or burst object created using 411 * <li>Create a new compilation instance by calling the 414 * <li>Set any desired properties on the compilation (for example, 417 * compilation by calling {@link ANeuralNetworksCompilation_setCaching}.</li> 418 * <li>Complete the compilation with {@link ANeuralNetworksCompilation_finish}.</li> 419 * <li>Use the compilation as many times as needed 422 * <li>Destroy the compilation with {@link ANeuralNetworksCompilation_free} 423 * once all executions using the compilation have completed.</li></ul></p> [all …]
|
/packages/modules/NeuralNetworks/common/cpu_operations/ |
D | LSHProjectionTest.cpp | 101 Compilation compilation(&model_); in Invoke() local 102 compilation.finish(); in Invoke() 103 Execution execution(&compilation); in Invoke()
|
D | MultinomialTest.cpp | 66 Compilation compilation(&model_); in Invoke() local 67 compilation.finish(); in Invoke() 68 Execution execution(&compilation); in Invoke()
|
D | EmbeddingLookupTest.cpp | 98 Compilation compilation(&model_); in Invoke() local 99 compilation.finish(); in Invoke() 100 Execution execution(&compilation); in Invoke()
|
/packages/modules/NeuralNetworks/shim_and_sl/include/ |
D | SupportLibraryWrapper.h | 359 ANeuralNetworksCompilation* compilation = nullptr; in createForDevices() local 363 devices.size(), &compilation)); in createForDevices() 364 return {result, Compilation(nnapi, compilation)}; in createForDevices() 479 Compilation(const NnApiSupportLibrary* nnapi, ANeuralNetworksCompilation* compilation) in Compilation() argument 480 : mNnApi(nnapi), mCompilation(compilation) {} in Compilation() 488 Execution(const NnApiSupportLibrary* nnapi, const Compilation* compilation) in Execution() argument 489 : mNnApi(nnapi), mCompilation(compilation->getHandle()) { in Execution() 490 int result = mNnApi->getFL5()->ANeuralNetworksExecution_create(compilation->getHandle(), in Execution()
|