Home
last modified time | relevance | path

Searched refs:testModel (Results 1 – 17 of 17) sorted by relevance

/packages/modules/NeuralNetworks/runtime/test/
DTestGenerated.cpp72 void executeInternal(const Compilation& compilation, const TestModel& testModel,
74 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel);
75 void executeOnce(const Model& model, const TestModel& testModel);
76 void executeMultithreadedOwnCompilation(const Model& model, const TestModel& testModel);
77 void executeMultithreadedSharedCompilation(const Model& model, const TestModel& testModel);
79 void execute(const TestModel& testModel);
182 const TestModel& testModel, Execution* execution, in createRequestWithDeviceMemories() argument
190 for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { in createRequestWithDeviceMemories()
192 const auto& operand = testModel.main.operands[testModel.main.inputIndexes[i]]; in createRequestWithDeviceMemories()
213 for (uint32_t i = 0; i < testModel.main.outputIndexes.size(); i++) { in createRequestWithDeviceMemories()
[all …]
DSupportLibraryTestGenerated.cpp81 const Compilation& compilation, const TestModel& testModel, Execution* execution,
85 void executeWithCompilation(const Compilation& compilation, const TestModel& testModel);
86 void executeOnce(const Model& model, const TestModel& testModel);
87 void executeMultithreadedOwnCompilation(const Model& model, const TestModel& testModel);
88 void executeMultithreadedSharedCompilation(const Model& model, const TestModel& testModel);
90 void execute(const TestModel& testModel);
253 void computeWithPtrs(const TestModel& testModel, Execution* execution, in computeWithPtrs() argument
258 createRequest(testModel, execution, outputs); in computeWithPtrs()
293 const Compilation& compilation, const TestModel& testModel, Execution* execution, in computeWithDeviceMemories() argument
304 for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { in computeWithDeviceMemories()
[all …]
DTestCompatibilityLayer.cpp66 void execute(const TestModel& testModel);
76 void CompatibilityLayerGeneratedTests::execute(const TestModel& testModel) { in execute() argument
78 createModel(testModel, mTestDynamicOutputShape, &model); in execute()
79 if (testModel.expectFailure && !model.isValid()) { in execute()
93 for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { in execute()
94 const auto& operand = testModel.main.operands[testModel.main.inputIndexes[i]]; in execute()
101 for (uint32_t i = 0; i < testModel.main.outputIndexes.size(); i++) { in execute()
102 const auto& operand = testModel.main.operands[testModel.main.outputIndexes[i]]; in execute()
122 checkResults(testModel, outputs); in execute()
136 bool compatibleTest(const TestModel& testModel) { in compatibleTest() argument
[all …]
DGeneratedTestUtils.cpp109 const NnApiSupportLibrary* nnapi, const TestModel& testModel) { argument
112 const TestModel& testModel) {
124 processSubgraph(testModel.main);
125 for (const TestSubgraph& subgraph : testModel.referenced) {
189 void createModel(const NnApiSupportLibrary* nnapi, const TestModel& testModel, argument
192 void createModel(const TestModel& testModel, bool testDynamicOutputShape, GeneratedModel* model) {
197 std::unique_ptr<MemoryWithPointer> memory = createConstantReferenceMemory(nnapi, testModel);
199 std::unique_ptr<MemoryWithPointer> memory = createConstantReferenceMemory(testModel);
204 refModels.reserve(testModel.referenced.size());
205 for (int i = 0; i < testModel.referenced.size(); ++i) {
[all …]
DGeneratedTestUtils.h45 const test_helper::TestModel& testModel = *GetParam().second;
87 void createModel(const NnApiSupportLibrary* nnapi, const test_helper::TestModel& testModel,
89 inline void createModel(const NnApiSupportLibrary* nnapi, const test_helper::TestModel& testModel, in createModel() argument
91 createModel(nnapi, testModel, /*testDynamicOutputShape=*/false, model); in createModel()
94 void createModel(const test_helper::TestModel& testModel, bool testDynamicOutputShape,
96 inline void createModel(const test_helper::TestModel& testModel, GeneratedModel* model) { in createModel() argument
97 createModel(testModel, /*testDynamicOutputShape=*/false, model); in createModel()
101 void createRequest(const test_helper::TestModel& testModel, test_wrapper::Execution* execution,
DTestCompliance.cpp224 generated_tests::createModel(testModel, &model); in TEST_P()
227 switch (testModel.minSupportedVersion) { in TEST_P()
255 INSTANTIATE_GENERATED_TEST(GeneratedComplianceTest, [](const TestModel& testModel) { in __anoncb1810160202() argument
256 return !testModel.expectFailure && testModel.minSupportedVersion != TestHalVersion::UNKNOWN; in __anoncb1810160202()
DTestRemoveDefaultArguments.cpp154 void test(const test_helper::TestModel& testModel, uint32_t originalInputCount, in test() argument
156 ASSERT_EQ(testModel.main.operations.size(), 1u); in test()
157 ASSERT_EQ(testModel.main.operations[0].inputs.size(), originalInputCount); in test()
162 generated_tests::createModel(testModel, &model); in test()
/packages/modules/NeuralNetworks/runtime/test/android_fuzzing/
DFuzzTest.cpp58 bool areSubgraphsAcyclic(const TestModel& testModel, size_t index, std::vector<Visited>* visited, in areSubgraphsAcyclic() argument
67 const auto& subgraph = index == 0 ? testModel.main : testModel.referenced[index - 1]; in areSubgraphsAcyclic()
73 if (!areSubgraphsAcyclic(testModel, subgraphIndex + 1, visited, order)) return false; in areSubgraphsAcyclic()
81 std::optional<std::vector<size_t>> getSubgraphOrder(const TestModel& testModel) { in getSubgraphOrder() argument
82 std::vector<Visited> visited(testModel.referenced.size() + 1, Visited::NOT_YET_VISITED); in getSubgraphOrder()
85 if (!areSubgraphsAcyclic(testModel, 0, &visited, &order)) return std::nullopt; in getSubgraphOrder()
89 std::optional<Model> CreateSubgraph(const TestModel& testModel, size_t subgraphIndex, in CreateSubgraph() argument
92 subgraphIndex == 0 ? testModel.main : testModel.referenced[subgraphIndex - 1]; in CreateSubgraph()
132 model.relaxComputationFloat32toFloat16(testModel.isRelaxed); in CreateSubgraph()
143 std::optional<std::vector<Model>> CreateModels(const TestModel& testModel) { in CreateModels() argument
[all …]
DDriverFuzzTest.cpp49 ExecutionResult<void> runTest(const ::test_helper::TestModel& testModel) { in runTest() argument
55 const auto model = NN_TRY(test::createModel(testModel)); in runTest()
65 const auto request = NN_TRY(test::createRequest(testModel)); in runTest()
78 void nnapiFuzzTest(const ::test_helper::TestModel& testModel) { in nnapiFuzzTest() argument
79 android::nn::runTest(testModel); in nnapiFuzzTest()
DFuzzHarness.cpp28 extern void nnapiFuzzTest(const ::test_helper::TestModel& testModel);
65 const TestModel testModel = convertToTestModel(model); in DEFINE_PROTO_FUZZER() local
66 if (!shouldSkip(testModel)) { in DEFINE_PROTO_FUZZER()
67 nnapiFuzzTest(testModel); in DEFINE_PROTO_FUZZER()
DGenerateCorpus.cpp179 const auto& [testName, testModel] = testCase; in createCorpusEntry()
180 const Test test = convertToTest(*testModel); in createCorpusEntry()
202 const auto filter = [](const TestModel& testModel) { return !testModel.expectFailure; }; in main() argument
DREADME.md61 `void nnapiFuzzTest(const TestModel& testModel)` (examples: [1][1], [2][2])
/packages/modules/NeuralNetworks/tools/test_generator/test_harness/
DTestUtils.cpp124 GeneralResult<Model> createModel(const TestModel& testModel) { in createModel() argument
129 NN_TRY(createSubgraph(testModel.main, &operandValues, &memoryBuilder)); in createModel()
131 refSubgraphs.reserve(testModel.referenced.size()); in createModel()
132 for (const auto& testSubgraph : testModel.referenced) { in createModel()
147 .relaxComputationFloat32toFloat16 = testModel.isRelaxed}; in createModel()
150 GeneralResult<Request> createRequest(const TestModel& testModel) { in createRequest() argument
153 inputs.reserve(testModel.main.inputIndexes.size()); in createRequest()
154 for (uint32_t operandIndex : testModel.main.inputIndexes) { in createRequest()
155 NN_RET_CHECK_LT(operandIndex, testModel.main.operands.size()) in createRequest()
157 << " exceeds number of operands " << testModel.main.operands.size(); in createRequest()
[all …]
DTestHarness.cpp295 TestModel convertQuant8AsymmOperandsToSigned(const TestModel& testModel) { in convertQuant8AsymmOperandsToSigned() argument
310 TestModel converted(testModel.copy()); in convertQuant8AsymmOperandsToSigned()
723 std::optional<TestModel> convertToFloat32Model(const TestModel& testModel) { in convertToFloat32Model() argument
725 if (testModel.referenced.size() > 0 || testModel.main.operations.size() > 1) { in convertToFloat32Model()
730 CHECK(!testModel.main.operations.empty()); in convertToFloat32Model()
731 const auto& operation = testModel.main.operations[0]; in convertToFloat32Model()
745 auto convert = [&testModel, &operation](const TestOperand& op, uint32_t index) { in convertToFloat32Model()
758 const auto& input0 = testModel.main.operands[input0Index]; in convertToFloat32Model()
787 TestModel converted = testModel; in convertToFloat32Model()
788 for (uint32_t i = 0; i < testModel.main.operands.size(); i++) { in convertToFloat32Model()
[all …]
/packages/modules/NeuralNetworks/runtime/test/fuzzing/
DRandomGraphGenerator.cpp252 TestModel testModel; in createTestModel() local
256 operand->opIndex = testModel.main.operands.size(); in createTestModel()
288 testModel.main.inputIndexes.push_back(operand->opIndex); in createTestModel()
290 testModel.main.outputIndexes.push_back(operand->opIndex); in createTestModel()
292 testModel.main.operands.push_back(std::move(testOperand)); in createTestModel()
307 testModel.main.operations.push_back(std::move(testOperation)); in createTestModel()
309 return testModel; in createTestModel()
/packages/modules/NeuralNetworks/tools/test_generator/test_harness/include/nnapi/
DTestUtils.h27 GeneralResult<Model> createModel(const ::test_helper::TestModel& testModel);
29 GeneralResult<Request> createRequest(const ::test_helper::TestModel& testModel);
/packages/modules/NeuralNetworks/tools/test_generator/test_harness/include/
DTestHarness.h462 int add(std::string name, const TestModel& testModel) { in add() argument
463 mTestModels.emplace(std::move(name), &testModel); in add()
538 TestModel convertQuant8AsymmOperandsToSigned(const TestModel& testModel);
546 SpecDumper(const TestModel& testModel, std::ostream& os) : kTestModel(testModel), mOs(os) {} in SpecDumper() argument
573 std::optional<TestModel> convertToFloat32Model(const TestModel& testModel);