From 51e0b138f9fd2bd5eb2f22d9e861e77d33397680 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Mon, 20 Apr 2020 16:12:06 +0100 Subject: 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 Change-Id: Ic0305014ed2638e3a3d1e7520972e3a2909e504b --- ConversionUtils.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'ConversionUtils.hpp') diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index d19131ce..15381338 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -1051,6 +1051,43 @@ bool GetOptionalConvolutionDilationParams(const HalOperation& operation, return success; } +template +bool GetOptionalBool(const HalOperation& operation, + uint32_t inputIndex, + const HalModel& model, + const ConversionData& data) +{ + using HalOperand = typename HalPolicy::Operand; + + const HalOperand* operand = GetInputOperand(operation, inputIndex, model); + if (!operand) + { + return false; + } + + if (!IsBool(*operand)) + { + return false; + } + + const void* valueAddress = GetOperandValueReadOnlyAddress(*operand, model, data); + if (!valueAddress) + { + return false; + } + + if (*(static_cast(valueAddress))) + { + return true; + } + else + { + return false; + } +} + template -- cgit v1.2.1