diff options
author | Slava Shklyaev <slavash@google.com> | 2020-06-18 18:47:06 +0100 |
---|---|---|
committer | Slava Shklyaev <slavash@google.com> | 2020-06-22 23:12:45 +0100 |
commit | 0fda6bb19a6fa83fe512dd6889b71e3ab37709bc (patch) | |
tree | ddd0be5472d98f67fc1198d11484921e728470f1 /nn/runtime/ExecutionPlan.cpp | |
parent | c8fc9ec598d12b0d2bc5694e692c99454da2c7a4 (diff) | |
download | ml-0fda6bb19a6fa83fe512dd6889b71e3ab37709bc.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
Diffstat (limited to 'nn/runtime/ExecutionPlan.cpp')
-rw-r--r-- | nn/runtime/ExecutionPlan.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nn/runtime/ExecutionPlan.cpp b/nn/runtime/ExecutionPlan.cpp index 1f540805f..1797475ac 100644 --- a/nn/runtime/ExecutionPlan.cpp +++ b/nn/runtime/ExecutionPlan.cpp @@ -555,6 +555,11 @@ int ExecutionStep::finishStepModel(const ModelBuilder* mainModel, bool* hasOutpu [](auto& e) { return e.second; }); NN_RETURN_IF_ERROR(mStepModel.identifyInputsAndOutputs(inputs.size(), inputs.data(), outputs.size(), outputs.data())); + // TODO: Model::finish() should use ValidationMode::RUNTIME when sending the + // step model to CpuDevice. Right now, this is harmless because the only + // difference in validation occurs with control flow operations and inputs + // or outputs of unknown size and we never send control flow operations to + // CpuDevice. We need to address this if this behavior changes (b/151634976). NN_RETURN_IF_ERROR(mStepModel.finish()); // TODO: Move compilation elsewhere? |