aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin May <kevin.may@arm.com>2020-02-10 12:10:07 +0000
committerKevin May <kevin.may@arm.com>2020-02-10 12:10:07 +0000
commit7bdaac5383dae5794897da9a006dac372519d1e5 (patch)
tree73c0f71cccfa08d626227b1cb38493d96f2b58a1
parent826dd41dc4de616059a61fb0aaec432311372c6c (diff)
downloadandroid-nn-driver-7bdaac5383dae5794897da9a006dac372519d1e5.tar.gz
IVGCVSW-3987 Add armnn::Exception warning and std::exception error
Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I4963fb4d44501287e161f7366f38557962d06cac
-rw-r--r--ArmnnPreparedModel.cpp23
-rw-r--r--ArmnnPreparedModel_1_2.cpp43
2 files changed, 56 insertions, 10 deletions
diff --git a/ArmnnPreparedModel.cpp b/ArmnnPreparedModel.cpp
index 2f1abef..0899430 100644
--- a/ArmnnPreparedModel.cpp
+++ b/ArmnnPreparedModel.cpp
@@ -209,9 +209,15 @@ Return<ErrorStatus> ArmnnPreparedModel<HalVersion>::execute(const Request& reque
pOutputTensors->emplace_back(i, outputTensor);
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute");
+ return ErrorStatus::GENERAL_FAILURE;
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ ALOGE("std::exception caught while preparing for EnqueueWorkload: %s", e.what());
NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute");
return ErrorStatus::GENERAL_FAILURE;
}
@@ -253,9 +259,15 @@ void ArmnnPreparedModel<HalVersion>::ExecuteGraph(
return;
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what());
+ cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph");
+ return;
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
+ ALOGE("std::exception caught from EnqueueWorkload: %s", e.what());
cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph");
return;
}
@@ -306,9 +318,14 @@ bool ArmnnPreparedModel<HalVersion>::ExecuteWithDummyInputs()
return false;
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("ExecuteWithDummyInputs: armnn::Exception caught from EnqueueWorkload: %s", e.what());
+ return false;
+ }
catch (std::exception& e)
{
- ALOGW("ExecuteWithDummyInputs: Exception caught from EnqueueWorkload: %s", e.what());
+ ALOGE("ExecuteWithDummyInputs: std::exception caught from EnqueueWorkload: %s", e.what());
return false;
}
return true;
diff --git a/ArmnnPreparedModel_1_2.cpp b/ArmnnPreparedModel_1_2.cpp
index a1e481d..29aaa1e 100644
--- a/ArmnnPreparedModel_1_2.cpp
+++ b/ArmnnPreparedModel_1_2.cpp
@@ -314,12 +314,19 @@ Return<void> ArmnnPreparedModel_1_2<HalVersion>::executeSynchronously(const Requ
pOutputTensors->emplace_back(i, outputTensor);
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
+ return Void();
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ ALOGE("std::exception caught while preparing for EnqueueWorkload: %s", e.what());
cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
return Void();
}
+
ALOGV("ArmnnPreparedModel_1_2::executeSynchronously() before Execution");
DumpTensorsIfRequired("Input", *pInputTensors);
@@ -345,9 +352,15 @@ Return<void> ArmnnPreparedModel_1_2<HalVersion>::executeSynchronously(const Requ
return Void();
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what());
+ cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
+ return Void();
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
+ ALOGE("std::exception caught from EnqueueWorkload: %s", e.what());
cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
return Void();
}
@@ -531,11 +544,16 @@ void ArmnnPreparedModel_1_2<HalVersion>::ExecuteGraph(
return;
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn:Exception caught from EnqueueWorkload: %s", e.what());
+ cb.callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming, "ArmnnPreparedModel_1_2::ExecuteGraph");
+ return;
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
- cb.callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming,
- "ArmnnPreparedModel_1_2::ExecuteGraph");
+ ALOGE("std::exception caught from EnqueueWorkload: %s", e.what());
+ cb.callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming, "ArmnnPreparedModel_1_2::ExecuteGraph");
return;
}
@@ -594,9 +612,14 @@ bool ArmnnPreparedModel_1_2<HalVersion>::ExecuteWithDummyInputs()
return false;
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("ExecuteWithDummyInputs: armnn::Exception caught from EnqueueWorkload: %s", e.what());
+ return false;
+ }
catch (std::exception& e)
{
- ALOGW("ExecuteWithDummyInputs: Exception caught from EnqueueWorkload: %s", e.what());
+ ALOGE("ExecuteWithDummyInputs: std::exception caught from EnqueueWorkload: %s", e.what());
return false;
}
return true;
@@ -707,9 +730,15 @@ Return <ErrorStatus> ArmnnPreparedModel_1_2<HalVersion>::Execute(const Request&
}
}
}
+ catch (armnn::Exception& e)
+ {
+ ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming, "ArmnnPreparedModel_1_2::execute");
+ return ErrorStatus::GENERAL_FAILURE;
+ }
catch (std::exception& e)
{
- ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
+ ALOGE("std::exception caught while preparing for EnqueueWorkload: %s", e.what());
callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming, "ArmnnPreparedModel_1_2::execute");
return ErrorStatus::GENERAL_FAILURE;
}