summaryrefslogtreecommitdiff
path: root/neuralnetworks/1.1/utils/src/Device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'neuralnetworks/1.1/utils/src/Device.cpp')
-rw-r--r--neuralnetworks/1.1/utils/src/Device.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/neuralnetworks/1.1/utils/src/Device.cpp b/neuralnetworks/1.1/utils/src/Device.cpp
index e45b17ec6e..f73d3f8253 100644
--- a/neuralnetworks/1.1/utils/src/Device.cpp
+++ b/neuralnetworks/1.1/utils/src/Device.cpp
@@ -57,7 +57,7 @@ nn::GeneralResult<nn::Capabilities> initCapabilities(V1_1::IDevice* device) {
};
const auto ret = device->getCapabilities_1_1(cb);
- NN_TRY(hal::utils::handleTransportError(ret));
+ HANDLE_TRANSPORT_FAILURE(ret);
return result;
}
@@ -120,7 +120,8 @@ std::pair<uint32_t, uint32_t> Device::getNumberOfCacheFilesNeeded() const {
nn::GeneralResult<void> Device::wait() const {
const auto ret = kDevice->ping();
- return hal::utils::handleTransportError(ret);
+ HANDLE_TRANSPORT_FAILURE(ret);
+ return {};
}
nn::GeneralResult<std::vector<bool>> Device::getSupportedOperations(const nn::Model& model) const {
@@ -150,7 +151,7 @@ nn::GeneralResult<std::vector<bool>> Device::getSupportedOperations(const nn::Mo
};
const auto ret = kDevice->getSupportedOperations_1_1(hidlModel, cb);
- NN_TRY(hal::utils::handleTransportError(ret));
+ HANDLE_TRANSPORT_FAILURE(ret);
return result;
}
@@ -171,7 +172,7 @@ nn::GeneralResult<nn::SharedPreparedModel> Device::prepareModel(
const auto scoped = kDeathHandler.protectCallback(cb.get());
const auto ret = kDevice->prepareModel_1_1(hidlModel, hidlPreference, cb);
- const auto status = NN_TRY(hal::utils::handleTransportError(ret));
+ const auto status = HANDLE_TRANSPORT_FAILURE(ret);
if (status != V1_0::ErrorStatus::NONE) {
const auto canonical = nn::convert(status).value_or(nn::ErrorStatus::GENERAL_FAILURE);
return NN_ERROR(canonical) << "prepareModel failed with " << toString(status);