diff options
Diffstat (limited to 'neuralnetworks/1.3/utils/src/Device.cpp')
-rw-r--r-- | neuralnetworks/1.3/utils/src/Device.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/neuralnetworks/1.3/utils/src/Device.cpp b/neuralnetworks/1.3/utils/src/Device.cpp index 7a7e2514ef..82837bac73 100644 --- a/neuralnetworks/1.3/utils/src/Device.cpp +++ b/neuralnetworks/1.3/utils/src/Device.cpp @@ -86,7 +86,7 @@ nn::GeneralResult<nn::Capabilities> initCapabilities(V1_3::IDevice* device) { }; const auto ret = device->getCapabilities_1_3(cb); - NN_TRY(hal::utils::handleTransportError(ret)); + HANDLE_TRANSPORT_FAILURE(ret); return result; } @@ -162,7 +162,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 { @@ -191,7 +192,7 @@ nn::GeneralResult<std::vector<bool>> Device::getSupportedOperations(const nn::Mo }; const auto ret = kDevice->getSupportedOperations_1_3(hidlModel, cb); - NN_TRY(hal::utils::handleTransportError(ret)); + HANDLE_TRANSPORT_FAILURE(ret); return result; } @@ -219,7 +220,7 @@ nn::GeneralResult<nn::SharedPreparedModel> Device::prepareModel( const auto ret = kDevice->prepareModel_1_3(hidlModel, hidlPreference, hidlPriority, hidlDeadline, hidlModelCache, hidlDataCache, hidlToken, cb); - const auto status = NN_TRY(hal::utils::handleTransportError(ret)); + const auto status = HANDLE_TRANSPORT_FAILURE(ret); if (status != ErrorStatus::NONE) { const auto canonical = nn::convert(status).value_or(nn::ErrorStatus::GENERAL_FAILURE); return NN_ERROR(canonical) << "prepareModel_1_3 failed with " << toString(status); @@ -241,7 +242,7 @@ nn::GeneralResult<nn::SharedPreparedModel> Device::prepareModelFromCache( const auto ret = kDevice->prepareModelFromCache_1_3(hidlDeadline, hidlModelCache, hidlDataCache, hidlToken, cb); - const auto status = NN_TRY(hal::utils::handleTransportError(ret)); + const auto status = HANDLE_TRANSPORT_FAILURE(ret); if (status != ErrorStatus::NONE) { const auto canonical = nn::convert(status).value_or(nn::ErrorStatus::GENERAL_FAILURE); return NN_ERROR(canonical) << "prepareModelFromCache_1_3 failed with " << toString(status); @@ -277,7 +278,7 @@ nn::GeneralResult<nn::SharedBuffer> Device::allocate( const auto ret = kDevice->allocate(hidlDesc, hidlPreparedModels, hidlInputRoles, hidlOutputRoles, cb); - NN_TRY(hal::utils::handleTransportError(ret)); + HANDLE_TRANSPORT_FAILURE(ret); return result; } |