diff options
author | Slava Shklyaev <slavash@google.com> | 2020-06-18 18:47:06 +0100 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2020-06-25 16:37:52 +0100 |
commit | 8088ca02e388d6df7f75975062ddd2a6bdebc07c (patch) | |
tree | ac725b265133be895e28034bb97b7ff3d524b48b /nn/runtime/Manager.cpp | |
parent | eb1372a96a73149d63a7cac3fe0ebd2f3276876e (diff) | |
download | ml-8088ca02e388d6df7f75975062ddd2a6bdebc07c.tar.gz |
Add HAL-level validation for CF operands of unknown size
At the NDK level, we allow IF and WHILE operations where an inner or
outer input or output operand has a type that is not fully specified.
However, this is not allowed At the HAL level. This CL adds HAL-level
validation.
See http://b/132458982#comment63
Bug: 132458982
Test: NNT_static
Change-Id: I54754d6241a1f8eb99717899ffd4f0ace4750060
Merged-In: I54754d6241a1f8eb99717899ffd4f0ace4750060
(cherry picked from commit 0fda6bb19a6fa83fe512dd6889b71e3ab37709bc)
Diffstat (limited to 'nn/runtime/Manager.cpp')
-rw-r--r-- | nn/runtime/Manager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nn/runtime/Manager.cpp b/nn/runtime/Manager.cpp index 2bc73f465..6b80d208d 100644 --- a/nn/runtime/Manager.cpp +++ b/nn/runtime/Manager.cpp @@ -656,8 +656,8 @@ std::pair<int, std::shared_ptr<PreparedModel>> CpuDevice::prepareModel( << "Should never call prepareModel with cache information on CpuDevice"; const Model model = makeModel(); - if (!validateModel(model) || !validateExecutionPreference(preference) || - !validatePriority(priority)) { + if (!validateModel(model, ValidationMode::RUNTIME) || + !validateExecutionPreference(preference) || !validatePriority(priority)) { return {ANEURALNETWORKS_OP_FAILED, nullptr}; } if (hasDeadlinePassed(deadline)) { |