Lines Matching refs:testModel
129 const TestModel& testModel) in DeviceMemoryAllocator() argument
130 : kDevice(device), kPreparedModel(preparedModel), kTestModel(testModel) {} in DeviceMemoryAllocator()
296 Model createModel(const TestModel& testModel) { in createModel() argument
302 Subgraph mainSubgraph = createSubgraph(testModel.main, &constCopySize, &constCopies, in createModel()
304 std::vector<Subgraph> refSubgraphs(testModel.referenced.size()); in createModel()
305 std::transform(testModel.referenced.begin(), testModel.referenced.end(), refSubgraphs.begin(), in createModel()
341 .relaxComputationFloat32toFloat16 = testModel.isRelaxed}; in createModel()
344 static bool isOutputSizeGreaterThanOne(const TestModel& testModel, uint32_t index) { in isOutputSizeGreaterThanOne() argument
345 const auto byteSize = testModel.main.operands[testModel.main.outputIndexes[index]].data.size(); in isOutputSizeGreaterThanOne()
370 std::optional<Request> createRequest(const TestModel& testModel, MemoryType memoryType);
371 std::vector<TestBuffer> getOutputBuffers(const TestModel& testModel,
395 std::optional<Request> ExecutionContext::createRequest(const TestModel& testModel, in createRequest() argument
402 DeviceMemoryAllocator allocator(kDevice, kPreparedModel, testModel); in createRequest()
407 std::vector<RequestArgument> inputs(testModel.main.inputIndexes.size()); in createRequest()
409 for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { in createRequest()
410 const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; in createRequest()
440 std::vector<RequestArgument> outputs(testModel.main.outputIndexes.size()); in createRequest()
442 for (uint32_t i = 0; i < testModel.main.outputIndexes.size(); i++) { in createRequest()
443 const auto& op = testModel.main.operands[testModel.main.outputIndexes[i]]; in createRequest()
508 for (uint32_t i = 0; i < testModel.main.inputIndexes.size(); i++) { in createRequest()
510 const auto& op = testModel.main.operands[testModel.main.inputIndexes[i]]; in createRequest()
520 std::vector<TestBuffer> ExecutionContext::getOutputBuffers(const TestModel& testModel, in getOutputBuffers() argument
530 const auto& op = testModel.main.operands[testModel.main.outputIndexes[i]]; in getOutputBuffers()
563 static bool hasZeroSizedOutput(const TestModel& testModel) { in hasZeroSizedOutput() argument
564 return std::any_of(testModel.main.outputIndexes.begin(), testModel.main.outputIndexes.end(), in hasZeroSizedOutput()
565 [&testModel](uint32_t index) { in hasZeroSizedOutput()
566 return testModel.main.operands[index].data.size() == 0; in hasZeroSizedOutput()
572 const TestModel& testModel, const TestConfig& testConfig, in EvaluatePreparedModel() argument
579 !isOutputSizeGreaterThanOne(testModel, 0)) { in EvaluatePreparedModel()
584 auto maybeRequest = context.createRequest(testModel, testConfig.memoryType); in EvaluatePreparedModel()
616 const auto executeAndCheckResults = [&preparedModel, &execution, &testConfig, &testModel, in EvaluatePreparedModel()
793 if (testConfig.executor == Executor::FENCED && hasZeroSizedOutput(testModel)) { in EvaluatePreparedModel()
802 outputShapes.size() == testModel.main.outputIndexes.size()); in EvaluatePreparedModel()
813 ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); in EvaluatePreparedModel()
822 ASSERT_EQ(outputShapes.size(), testModel.main.outputIndexes.size()); in EvaluatePreparedModel()
831 testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; in EvaluatePreparedModel()
850 testModel.main.operands[testModel.main.outputIndexes[i]].dimensions; in EvaluatePreparedModel()
858 const std::vector<TestBuffer> outputs = context.getOutputBuffers(testModel, request); in EvaluatePreparedModel()
861 checkResults(testModel, outputs); in EvaluatePreparedModel()
875 const TestModel& testModel, TestKind testKind) { in EvaluatePreparedModel() argument
942 EvaluatePreparedModel(device, preparedModel, testModel, testConfig); in EvaluatePreparedModel()
953 const TestModel& testModel, in EvaluatePreparedCoupledModels() argument
966 EvaluatePreparedModel(device, preparedModel, testModel, testConfig, &baseSkipped); in EvaluatePreparedCoupledModels()
985 void Execute(const std::shared_ptr<IDevice>& device, const TestModel& testModel, in Execute() argument
987 Model model = createModel(testModel); in Execute()
1001 EvaluatePreparedModel(device, preparedModel, testModel, testKind); in Execute()
1007 EvaluatePreparedModel(device, preparedModel, testModel, testKind); in Execute()
1011 ASSERT_TRUE(testModel.hasQuant8CoupledOperands()); in Execute()
1014 TestModel signedQuantizedModel = convertQuant8AsymmOperandsToSigned(testModel); in Execute()
1033 EvaluatePreparedCoupledModels(device, preparedModel, testModel, preparedCoupledModel, in Execute()
1117 [](const TestModel& testModel) { return !testModel.expectFailure; }); in __anon4cf4456d0702() argument
1119 INSTANTIATE_GENERATED_TEST(DynamicOutputShapeTest, [](const TestModel& testModel) { in __anon4cf4456d0802() argument
1120 return !testModel.expectFailure && !testModel.hasScalarOutputs(); in __anon4cf4456d0802()
1124 [](const TestModel& testModel) { return !testModel.expectFailure; }); in __anon4cf4456d0902() argument
1127 [](const TestModel& testModel) { return !testModel.expectFailure; }); in __anon4cf4456d0a02() argument
1129 INSTANTIATE_GENERATED_TEST(QuantizationCouplingTest, [](const TestModel& testModel) { in __anon4cf4456d0b02() argument
1130 return !testModel.expectFailure && testModel.hasQuant8CoupledOperands() && in __anon4cf4456d0b02()
1131 testModel.main.operations.size() == 1; in __anon4cf4456d0b02()
1134 INSTANTIATE_GENERATED_TEST(InfiniteLoopTimeoutTest, [](const TestModel& testModel) { in __anon4cf4456d0c02() argument
1135 return testModel.isInfiniteLoopTimeoutTest(); in __anon4cf4456d0c02()