diff options
Diffstat (limited to 'nn/common/include')
-rw-r--r-- | nn/common/include/Utils.h | 3 | ||||
-rw-r--r-- | nn/common/include/ValidateHal.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/nn/common/include/Utils.h b/nn/common/include/Utils.h index ca11c5ebc..4bbbf8215 100644 --- a/nn/common/include/Utils.h +++ b/nn/common/include/Utils.h @@ -391,6 +391,9 @@ struct SubgraphValidationHelper { std::function<const hal::Operand*(const hal::Operand&, uint32_t)> getSubgraphInputOperand; // Gets the specified output operand of a subgraph referenced by a given operand. std::function<const hal::Operand*(const hal::Operand&, uint32_t)> getSubgraphOutputOperand; + // Whether control flow operations with inner or outer input or output + // operands of unknown size are allowed. + bool allowControlFlowOperationWithOperandOfUnknownSize; }; // Returns ANEURALNETWORKS_NO_ERROR if the corresponding operation is defined and can handle the diff --git a/nn/common/include/ValidateHal.h b/nn/common/include/ValidateHal.h index 7b097fd20..32d7662ed 100644 --- a/nn/common/include/ValidateHal.h +++ b/nn/common/include/ValidateHal.h @@ -37,6 +37,10 @@ enum class HalVersion : int32_t { enum class IOType { INPUT, OUTPUT }; using PreparedModelRole = std::tuple<const hal::IPreparedModel*, IOType, uint32_t>; +// 1.3 HAL does not support control flow operations with operands of unknown size. +// See http://b/132458982#comment63. +enum class ValidationMode { DRIVER, RUNTIME }; + // Verifies that the model is valid, i.e. it is consistent, takes // only acceptable values, the constants don't extend outside the memory // regions they are part of, etc. @@ -44,7 +48,7 @@ using PreparedModelRole = std::tuple<const hal::IPreparedModel*, IOType, uint32_ // are correctly defined, as these are specific to each implementation. // Each driver should do their own validation of OEM types. template <class T_Model> -bool validateModel(const T_Model& model); +bool validateModel(const T_Model& model, ValidationMode mode = ValidationMode::DRIVER); // Verifies that the request for the given model is valid. // IMPORTANT: This function cannot validate that OEM operation and operands |