Allow implicit conversions for NN errors -- hal
This change allows GeneralErrors to be created from a string and allows
ExecutionErrors to be created from a string or a GeneralError.
This makes error handling more terse, removing the need for helper
functions such as makeGeneralFailure or makeExecutionFailure.
Bug: N/A
Test: mma
Change-Id: I8c5e80a2eb4f399fad64aab763fe6fa08cf8d1db
diff --git a/neuralnetworks/aidl/utils/src/Execution.cpp b/neuralnetworks/aidl/utils/src/Execution.cpp
index 2aee8a6..13d4f32 100644
--- a/neuralnetworks/aidl/utils/src/Execution.cpp
+++ b/neuralnetworks/aidl/utils/src/Execution.cpp
@@ -60,7 +60,7 @@
nn::ExecutionResult<std::pair<std::vector<nn::OutputShape>, nn::Timing>> Execution::compute(
const nn::OptionalTimePoint& deadline) const {
- const auto aidlDeadline = NN_TRY(hal::utils::makeExecutionFailure(convert(deadline)));
+ const auto aidlDeadline = NN_TRY(convert(deadline));
return kPreparedModel->executeInternal(kRequest, kMeasure, aidlDeadline, kLoopTimeoutDuration,
kRelocation);
}