aboutsummaryrefslogtreecommitdiff
path: root/ArmnnDriverImpl.cpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2018-10-25 15:39:33 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2018-10-25 16:57:26 +0100
commit8d50f8f4b848547635a74e6fdec29f632748ebb1 (patch)
tree50b2c00fa2a9e7a4e1dc24326e39a3338f1ec296 /ArmnnDriverImpl.cpp
parent50db26cbd83e7753c1581cc8c29b8e575da66ade (diff)
downloadandroid-nn-driver-8d50f8f4b848547635a74e6fdec29f632748ebb1.tar.gz
IVGCVSW-2051 Added unit tests in the Android NN Driver for the new
Mean layer * Added unit tests (in a new file test/1.1/Mean.cpp) * Refactored ArmnnDriverImpl to remove redundant tags in the log messages * Modified AddInputOperand to accept a quantized input tensor Change-Id: Ie037ce426777daab28b0501124e1cc8686ad6184
Diffstat (limited to 'ArmnnDriverImpl.cpp')
-rw-r--r--ArmnnDriverImpl.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp
index 267574c1..a3c2e10f 100644
--- a/ArmnnDriverImpl.cpp
+++ b/ArmnnDriverImpl.cpp
@@ -120,14 +120,12 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
if (!runtime)
{
- return FailPrepareModel(ErrorStatus::DEVICE_UNAVAILABLE,
- "ArmnnDriverImpl::prepareModel: Device unavailable", cb);
+ return FailPrepareModel(ErrorStatus::DEVICE_UNAVAILABLE, "Device unavailable", cb);
}
if (!android::nn::validateModel(model))
{
- return FailPrepareModel(ErrorStatus::INVALID_ARGUMENT,
- "ArmnnDriverImpl::prepareModel: Invalid model passed as input", cb);
+ return FailPrepareModel(ErrorStatus::INVALID_ARGUMENT, "Invalid model passed as input", cb);
}
// Deliberately ignore any unsupported operations requested by the options -
@@ -140,8 +138,7 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
if (modelConverter.GetConversionResult() != ConversionResult::Success)
{
- FailPrepareModel(ErrorStatus::GENERAL_FAILURE,
- "ArmnnDriverImpl::prepareModel: ModelToINetworkConverter failed", cb);
+ FailPrepareModel(ErrorStatus::GENERAL_FAILURE, "ModelToINetworkConverter failed", cb);
return ErrorStatus::NONE;
}
@@ -162,7 +159,7 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
catch (armnn::Exception &e)
{
stringstream message;
- message << "ArmnnDriverImpl::prepareModel: armnn::Exception (" << e.what() << ") caught from optimize.";
+ message << "armnn::Exception (" << e.what() << ") caught from optimize.";
FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
return ErrorStatus::NONE;
}
@@ -171,12 +168,12 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
if (!optNet)
{
stringstream message;
- message << "ArmnnDriverImpl::prepareModel: Invalid optimized network";
- for (const string& msg : errMessages) {
+ message << "Invalid optimized network";
+ for (const string& msg : errMessages)
+ {
message << "\n" << msg;
}
- FailPrepareModel(ErrorStatus::GENERAL_FAILURE,
- message.str(), cb);
+ FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
return ErrorStatus::NONE;
}
@@ -190,14 +187,13 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
{
if (runtime->LoadNetwork(netId, move(optNet)) != armnn::Status::Success)
{
- return FailPrepareModel(ErrorStatus::GENERAL_FAILURE,
- "ArmnnDriverImpl::prepareModel: Network could not be loaded", cb);
+ return FailPrepareModel(ErrorStatus::GENERAL_FAILURE, "Network could not be loaded", cb);
}
}
catch (armnn::Exception& e)
{
stringstream message;
- message << "ArmnnDriverImpl::prepareModel: armnn::Exception (" << e.what()<< ") caught from LoadNetwork.";
+ message << "armnn::Exception (" << e.what()<< ") caught from LoadNetwork.";
FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
return ErrorStatus::NONE;
}
@@ -225,7 +221,7 @@ Return<ErrorStatus> ArmnnDriverImpl<HalPolicy>::prepareModel(
catch (const armnn::Exception& error)
{
ALOGE("ArmnnDriverImpl::prepareModel: Failed to save CL tuned parameters file '%s': %s",
- options.GetClTunedParametersFile().c_str(), error.what());
+ options.GetClTunedParametersFile().c_str(), error.what());
}
}
@@ -252,4 +248,4 @@ template class ArmnnDriverImpl<hal_1_0::HalPolicy>;
template class ArmnnDriverImpl<hal_1_1::HalPolicy>;
#endif
-} // namespace armnn_driver \ No newline at end of file
+} // namespace armnn_driver