From 0b18d9740f04cc4e9cb6000a76b9c1dcd8327e24 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 30 Jan 2020 18:11:13 +0000 Subject: COMPMID-2762: Add support for QASYMM8_SIGNED in CLReductionOperation and CLReduceMean Change-Id: Ib6babd9ad80c57cf21c2f0ee2aab404221088595 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2670 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- tests/validation/reference/ReductionOperation.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/validation/reference/ReductionOperation.cpp') diff --git a/tests/validation/reference/ReductionOperation.cpp b/tests/validation/reference/ReductionOperation.cpp index 9c2c8eeb94..9b35cdf6f5 100644 --- a/tests/validation/reference/ReductionOperation.cpp +++ b/tests/validation/reference/ReductionOperation.cpp @@ -289,6 +289,21 @@ SimpleTensor reduction_operation(const SimpleTensor &src, cons } } +template <> +SimpleTensor reduction_operation(const SimpleTensor &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op) +{ + if(src.data_type() == DataType::QASYMM8_SIGNED) + { + SimpleTensor src_f = convert_from_asymmetric(src); + SimpleTensor dst_f = reference::reduction_operation(src_f, dst_shape, axis, op); + return convert_to_asymmetric(dst_f, src.quantization_info()); + } + else + { + return compute_reduction_operation(src, dst_shape, axis, op); + } +} + template SimpleTensor reduction_operation(const SimpleTensor &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op); template SimpleTensor reduction_operation(const SimpleTensor &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op); -- cgit v1.2.1