Add new OperandType BOOL.
- Add new enum OperandType::BOOL.
- Add v1.2 Operand, OperandType.
- Add VTS validation tests for BOOL.
Bug: 117423393
Test: NeuralNetworksTest_static
Test: VtsHalNeuralnetworksV1_2TargetTest
Change-Id: I420e2afeb09b881a499eee6b138c1f26e9874f5a
Merged-In: I420e2afeb09b881a499eee6b138c1f26e9874f5a
(cherry picked from commit abad9eac448cc61582a9a658a231010358051b97)
diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
index 7ec6ff1..5a8b8c5 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
@@ -26,9 +26,7 @@
namespace V1_2 {
using V1_0::IPreparedModel;
-using V1_0::Operand;
using V1_0::OperandLifeTime;
-using V1_0::OperandType;
using V1_1::ExecutionPreference;
namespace vts {
@@ -131,10 +129,10 @@
///////////////////////// VALIDATE MODEL OPERAND TYPE /////////////////////////
static const int32_t invalidOperandTypes[] = {
- static_cast<int32_t>(OperandType::FLOAT32) - 1, // lower bound fundamental
- static_cast<int32_t>(OperandType::TENSOR_QUANT8_ASYMM) + 1, // upper bound fundamental
- static_cast<int32_t>(OperandType::OEM) - 1, // lower bound OEM
- static_cast<int32_t>(OperandType::TENSOR_OEM_BYTE) + 1, // upper bound OEM
+ static_cast<int32_t>(OperandType::FLOAT32) - 1, // lower bound fundamental
+ static_cast<int32_t>(OperandType::BOOL) + 1, // upper bound fundamental
+ static_cast<int32_t>(OperandType::OEM) - 1, // lower bound OEM
+ static_cast<int32_t>(OperandType::TENSOR_OEM_BYTE) + 1, // upper bound OEM
};
static void mutateOperandTypeTest(const sp<IDevice>& device, const Model& model) {
@@ -157,6 +155,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
return 1;
case OperandType::TENSOR_FLOAT32:
case OperandType::TENSOR_INT32:
@@ -185,6 +184,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
case OperandType::TENSOR_FLOAT32:
return 1.0f;
case OperandType::TENSOR_INT32:
@@ -214,6 +214,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
case OperandType::TENSOR_FLOAT32:
case OperandType::TENSOR_INT32:
return {1};
@@ -253,6 +254,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
newOperand.dimensions = hidl_vec<uint32_t>();
newOperand.scale = 0.0f;
newOperand.zeroPoint = 0;