diff options
author | Michael Butler <butlermichael@google.com> | 2021-03-10 18:41:05 -0800 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2021-04-02 22:02:38 -0700 |
commit | 8414a6ebf902cd08a47e4902d8ae61a7022cde25 (patch) | |
tree | d2762f97d72b6dc4ae3f2d579de8ff96b093a6a9 /neuralnetworks/aidl/utils/test/PreparedModelTest.cpp | |
parent | 388bcebc8f66e699f972acdc0b217da1694eb4b0 (diff) |
Add additional parameters for NN Burst -- HAL
Adds deadline and loopTimeoutDuration to nn::IBurst::execute.
This CL additionally adds a test case for
IPreparedModel::configureExecutionBurst and adds the suffix "_H" to
the header guards that were missing "_H".
Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
Merged-In: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
(cherry picked from commit bbbdb0d5f118efa8159c3cc98304208fd7631609)
Diffstat (limited to 'neuralnetworks/aidl/utils/test/PreparedModelTest.cpp')
-rw-r--r-- | neuralnetworks/aidl/utils/test/PreparedModelTest.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp index 7e28861054..83304bc103 100644 --- a/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp +++ b/neuralnetworks/aidl/utils/test/PreparedModelTest.cpp @@ -252,7 +252,19 @@ TEST(PreparedModelTest, executeFencedDeadObject) { EXPECT_EQ(result.error().code, nn::ErrorStatus::DEAD_OBJECT); } -// TODO: test burst execution if/when it is added to nn::IPreparedModel. +TEST(PreparedModelTest, configureExecutionBurst) { + // setup test + const auto mockPreparedModel = MockPreparedModel::create(); + const auto preparedModel = PreparedModel::create(mockPreparedModel).value(); + + // run test + const auto result = preparedModel->configureExecutionBurst(); + + // verify result + ASSERT_TRUE(result.has_value()) + << "Failed with " << result.error().code << ": " << result.error().message; + EXPECT_NE(result.value(), nullptr); +} TEST(PreparedModelTest, getUnderlyingResource) { // setup test |