Make operation validation return Result<Version> Bug: N/A Test: mma Test: NeuralNetworksTest_static Change-Id: I47c12e13fcb41f832e31043b3f14e7b93472b0f8
diff --git a/common/OperationsUtils.cpp b/common/OperationsUtils.cpp index d65566f..c5a71e9 100644 --- a/common/OperationsUtils.cpp +++ b/common/OperationsUtils.cpp
@@ -86,8 +86,9 @@ [context](uint32_t index) { return context->getOutputType(index); }); } -bool validateVersion(const IOperationValidationContext* context, Version minSupportedVersion) { - if (context->getVersion() < minSupportedVersion) { +bool validateVersion(const IOperationValidationContext* context, Version contextVersion, + Version minSupportedVersion) { + if (contextVersion < minSupportedVersion) { std::ostringstream message; message << "Operation " << context->getOperationName() << " with inputs {"; for (uint32_t i = 0, n = context->getNumInputs(); i < n; ++i) { @@ -104,7 +105,7 @@ message << context->getOutputType(i); } message << "} is only supported since " << minSupportedVersion << " (validating using " - << context->getVersion() << ")"; + << contextVersion << ")"; NN_RET_CHECK_FAIL() << message.str(); } return true;