aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2020-04-20 16:12:06 +0100
committerDavid Monahan <david.monahan@arm.com>2020-04-21 10:51:34 +0000
commit51e0b138f9fd2bd5eb2f22d9e861e77d33397680 (patch)
tree68e5811ef2182792e5d8fa1ab0d90e5861199fe7
parent7b9ce8d48b74a3487f0597eedc38523c4a8e02ee (diff)
downloadandroid-nn-driver-51e0b138f9fd2bd5eb2f22d9e861e77d33397680.tar.gz
IVGCVSW-4675 Fix VTS 1.3 GeneratedTest.Test/armnn_resize*
* Added GetOptionalBool function * Added checks to Resize for unsupported operands AlignCorners and HalfPixelCenters !armnn:3062 Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: Ic0305014ed2638e3a3d1e7520972e3a2909e504b
-rw-r--r--ConversionUtils.hpp37
-rw-r--r--ConversionUtils_1_2.hpp11
2 files changed, 48 insertions, 0 deletions
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp
index d19131c..1538133 100644
--- a/ConversionUtils.hpp
+++ b/ConversionUtils.hpp
@@ -1052,6 +1052,43 @@ bool GetOptionalConvolutionDilationParams(const HalOperation& operation,
}
template<typename HalPolicy,
+ typename HalOperation = typename HalPolicy::Operation,
+ typename HalModel = typename HalPolicy::Model>
+bool GetOptionalBool(const HalOperation& operation,
+ uint32_t inputIndex,
+ const HalModel& model,
+ const ConversionData& data)
+{
+ using HalOperand = typename HalPolicy::Operand;
+
+ const HalOperand* operand = GetInputOperand<HalPolicy>(operation, inputIndex, model);
+ if (!operand)
+ {
+ return false;
+ }
+
+ if (!IsBool(*operand))
+ {
+ return false;
+ }
+
+ const void* valueAddress = GetOperandValueReadOnlyAddress<HalPolicy>(*operand, model, data);
+ if (!valueAddress)
+ {
+ return false;
+ }
+
+ if (*(static_cast<const bool*>(valueAddress)))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+template<typename HalPolicy,
typename HalOperand = typename HalPolicy::Operand,
typename HalModel = typename HalPolicy::Model>
bool GetTensorInt32Values(const HalOperand& operand,
diff --git a/ConversionUtils_1_2.hpp b/ConversionUtils_1_2.hpp
index 460c88b..c87cb03 100644
--- a/ConversionUtils_1_2.hpp
+++ b/ConversionUtils_1_2.hpp
@@ -1825,6 +1825,17 @@ bool ConvertResize(const HalOperation& operation,
return Fail("%s: Operand has invalid data type for resizing by scale", __func__);
}
+ descriptor.m_BilinearAlignCorners = GetOptionalBool<HalPolicy>(operation, 4, model, data);
+ descriptor.m_HalfPixelCenters = GetOptionalBool<HalPolicy>(operation, 5, model, data);
+ if (descriptor.m_BilinearAlignCorners)
+ {
+ return Fail("%s: Resize Align Corners is not currently supported", __func__);
+ }
+ if (descriptor.m_HalfPixelCenters)
+ {
+ return Fail("%s: Resize Half Pixel Centers is not currently supported", __func__);
+ }
+
bool isSupported = false;
FORWARD_LAYER_SUPPORT_FUNC(__func__,
IsResizeSupported,