diff options
author | Xusong Wang <xusongw@google.com> | 2021-10-05 14:10:41 -0700 |
---|---|---|
committer | Xusong Wang <xusongw@google.com> | 2022-01-18 10:51:29 -0800 |
commit | 11f30c81ef7d45fd97bf0dcc3f3ba2ae42689504 (patch) | |
tree | 251f0fb62aa0f9d55b4a0d121f41f73507261163 /neuralnetworks/aidl/utils/src/Callbacks.cpp | |
parent | 018fc3cac8b2361ad28a97685f9449a99326c9cd (diff) |
Reusable execution at HAL level -- HAL.
This CL modifies the canonical/AIDL adapter to use IExecution object
if available.
Bug: 202405342
Bug: 202431255
Test: NNT_static
Test: CtsNNAPITestCases
Test: VtsHalNeuralnetworksTargetTest
Change-Id: I6aac3c57f97ac87a5ba3f78cfd843fcc403decff
Merged-In: I6aac3c57f97ac87a5ba3f78cfd843fcc403decff
(cherry picked from commit 7f5c7d293c2dad462dc9c0f1f1a160fb2c2c9a9b)
Diffstat (limited to 'neuralnetworks/aidl/utils/src/Callbacks.cpp')
-rw-r--r-- | neuralnetworks/aidl/utils/src/Callbacks.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/neuralnetworks/aidl/utils/src/Callbacks.cpp b/neuralnetworks/aidl/utils/src/Callbacks.cpp index 8084970690..554f3faa73 100644 --- a/neuralnetworks/aidl/utils/src/Callbacks.cpp +++ b/neuralnetworks/aidl/utils/src/Callbacks.cpp @@ -38,16 +38,17 @@ namespace { // nn::kVersionFeatureLevel5. On failure, this function returns with the appropriate // nn::GeneralError. nn::GeneralResult<nn::SharedPreparedModel> prepareModelCallback( - ErrorStatus status, const std::shared_ptr<IPreparedModel>& preparedModel) { + ErrorStatus status, const std::shared_ptr<IPreparedModel>& preparedModel, + nn::Version featureLevel) { HANDLE_STATUS_AIDL(status) << "model preparation failed with " << toString(status); - return NN_TRY(PreparedModel::create(preparedModel)); + return NN_TRY(PreparedModel::create(preparedModel, featureLevel)); } } // namespace ndk::ScopedAStatus PreparedModelCallback::notify( ErrorStatus status, const std::shared_ptr<IPreparedModel>& preparedModel) { - mData.put(prepareModelCallback(status, preparedModel)); + mData.put(prepareModelCallback(status, preparedModel, kFeatureLevel)); return ndk::ScopedAStatus::ok(); } |