Loading neuralnetworks/1.3/vts/functional/QualityOfServiceTests.cpp +14 −25 Original line number Diff line number Diff line Loading @@ -134,10 +134,9 @@ void runPrepareModelTest(const sp<IDevice>& device, const Model& model, Priority } else { switch (deadlineBound.value()) { case DeadlineBoundType::NOW: // If the execution was launched with a deadline of NOW, the // deadline has already passed when the driver would launch the // execution. In this case, the driver must return // MISSED_DEADLINE_*. case DeadlineBoundType::SHORT: // Either the driver successfully completed the task or it // aborted and returned MISSED_DEADLINE_*. EXPECT_TRUE(prepareReturnStatus == ErrorStatus::NONE || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT); Loading @@ -148,13 +147,6 @@ void runPrepareModelTest(const sp<IDevice>& device, const Model& model, Priority // of the switch statement. EXPECT_EQ(ErrorStatus::NONE, prepareReturnStatus); break; case DeadlineBoundType::SHORT: // Either the driver successfully completed the task in time or // it aborted within the compliance time. EXPECT_TRUE(prepareReturnStatus == ErrorStatus::NONE || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT); break; } } ASSERT_EQ(prepareReturnStatus == ErrorStatus::NONE, preparedModel.get() != nullptr); Loading Loading @@ -206,7 +198,10 @@ static MaybeResults executeSynchronously(const sp<IPreparedModel>& preparedModel // configure results callback MaybeResults results; const auto cb = [&results](const auto&... args) { *results = {args...}; }; const auto cb = [&results](ErrorStatus status, const hidl_vec<OutputShape>& outputShapes, const Timing& timing) { results.emplace(status, outputShapes, timing); }; // run execution const Return<void> ret = Loading Loading @@ -235,27 +230,19 @@ void runExecutionTest(const sp<IPreparedModel>& preparedModel, const TestModel& // Validate deadline information if applicable. switch (deadlineBound) { case DeadlineBoundType::NOW: // If the execution was launched with a deadline of NOW, the // deadline has already passed when the driver would launch the // execution. In this case, the driver must return // MISSED_DEADLINE_*. case DeadlineBoundType::SHORT: // Either the driver successfully completed the task or it // aborted and returned MISSED_DEADLINE_*. ASSERT_TRUE(status == ErrorStatus::NONE || status == ErrorStatus::MISSED_DEADLINE_TRANSIENT || status == ErrorStatus::MISSED_DEADLINE_PERSISTENT); return; break; case DeadlineBoundType::UNLIMITED: // If an unlimited deadline is supplied, we expect the execution to // proceed normally. In this case, check it normally by breaking out // of the switch statement. ASSERT_EQ(ErrorStatus::NONE, status); break; case DeadlineBoundType::SHORT: // Either the driver successfully completed the task in time or // it aborted within the compliance time. EXPECT_TRUE(status == ErrorStatus::NONE || status == ErrorStatus::MISSED_DEADLINE_TRANSIENT || status == ErrorStatus::MISSED_DEADLINE_PERSISTENT); break; } // If the model output operands are fully specified, outputShapes must be either Loading @@ -277,8 +264,10 @@ void runExecutionTest(const sp<IPreparedModel>& preparedModel, const TestModel& const std::vector<TestBuffer> outputs = getOutputBuffers(request10); // We want "close-enough" results. if (status == ErrorStatus::NONE) { checkResults(testModel, outputs); } } void runExecutionTests(const sp<IPreparedModel>& preparedModel, const TestModel& testModel, const Request& request) { Loading Loading
neuralnetworks/1.3/vts/functional/QualityOfServiceTests.cpp +14 −25 Original line number Diff line number Diff line Loading @@ -134,10 +134,9 @@ void runPrepareModelTest(const sp<IDevice>& device, const Model& model, Priority } else { switch (deadlineBound.value()) { case DeadlineBoundType::NOW: // If the execution was launched with a deadline of NOW, the // deadline has already passed when the driver would launch the // execution. In this case, the driver must return // MISSED_DEADLINE_*. case DeadlineBoundType::SHORT: // Either the driver successfully completed the task or it // aborted and returned MISSED_DEADLINE_*. EXPECT_TRUE(prepareReturnStatus == ErrorStatus::NONE || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT); Loading @@ -148,13 +147,6 @@ void runPrepareModelTest(const sp<IDevice>& device, const Model& model, Priority // of the switch statement. EXPECT_EQ(ErrorStatus::NONE, prepareReturnStatus); break; case DeadlineBoundType::SHORT: // Either the driver successfully completed the task in time or // it aborted within the compliance time. EXPECT_TRUE(prepareReturnStatus == ErrorStatus::NONE || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_TRANSIENT || prepareReturnStatus == ErrorStatus::MISSED_DEADLINE_PERSISTENT); break; } } ASSERT_EQ(prepareReturnStatus == ErrorStatus::NONE, preparedModel.get() != nullptr); Loading Loading @@ -206,7 +198,10 @@ static MaybeResults executeSynchronously(const sp<IPreparedModel>& preparedModel // configure results callback MaybeResults results; const auto cb = [&results](const auto&... args) { *results = {args...}; }; const auto cb = [&results](ErrorStatus status, const hidl_vec<OutputShape>& outputShapes, const Timing& timing) { results.emplace(status, outputShapes, timing); }; // run execution const Return<void> ret = Loading Loading @@ -235,27 +230,19 @@ void runExecutionTest(const sp<IPreparedModel>& preparedModel, const TestModel& // Validate deadline information if applicable. switch (deadlineBound) { case DeadlineBoundType::NOW: // If the execution was launched with a deadline of NOW, the // deadline has already passed when the driver would launch the // execution. In this case, the driver must return // MISSED_DEADLINE_*. case DeadlineBoundType::SHORT: // Either the driver successfully completed the task or it // aborted and returned MISSED_DEADLINE_*. ASSERT_TRUE(status == ErrorStatus::NONE || status == ErrorStatus::MISSED_DEADLINE_TRANSIENT || status == ErrorStatus::MISSED_DEADLINE_PERSISTENT); return; break; case DeadlineBoundType::UNLIMITED: // If an unlimited deadline is supplied, we expect the execution to // proceed normally. In this case, check it normally by breaking out // of the switch statement. ASSERT_EQ(ErrorStatus::NONE, status); break; case DeadlineBoundType::SHORT: // Either the driver successfully completed the task in time or // it aborted within the compliance time. EXPECT_TRUE(status == ErrorStatus::NONE || status == ErrorStatus::MISSED_DEADLINE_TRANSIENT || status == ErrorStatus::MISSED_DEADLINE_PERSISTENT); break; } // If the model output operands are fully specified, outputShapes must be either Loading @@ -277,8 +264,10 @@ void runExecutionTest(const sp<IPreparedModel>& preparedModel, const TestModel& const std::vector<TestBuffer> outputs = getOutputBuffers(request10); // We want "close-enough" results. if (status == ErrorStatus::NONE) { checkResults(testModel, outputs); } } void runExecutionTests(const sp<IPreparedModel>& preparedModel, const TestModel& testModel, const Request& request) { Loading