aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/ReductionOperation.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-01-30 18:11:13 +0000
committerMichalis Spyrou <michalis.spyrou@arm.com>2020-02-07 15:17:57 +0000
commit0b18d9740f04cc4e9cb6000a76b9c1dcd8327e24 (patch)
tree8ffd0b1c676b13499314d3396818f0c30c1020f2 /tests/validation/reference/ReductionOperation.cpp
parentc971cf1034a61875c8e8c87d48634cbfac3865fd (diff)
downloadComputeLibrary-0b18d9740f04cc4e9cb6000a76b9c1dcd8327e24.tar.gz
COMPMID-2762: Add support for QASYMM8_SIGNED in CLReductionOperation and CLReduceMean
Change-Id: Ib6babd9ad80c57cf21c2f0ee2aab404221088595 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2670 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/reference/ReductionOperation.cpp')
-rw-r--r--tests/validation/reference/ReductionOperation.cpp15
1 files changed, 15 insertions, 0 deletions
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<uint8_t> reduction_operation(const SimpleTensor<uint8_t> &src, cons
}
}
+template <>
+SimpleTensor<int8_t> reduction_operation(const SimpleTensor<int8_t> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
+{
+ if(src.data_type() == DataType::QASYMM8_SIGNED)
+ {
+ SimpleTensor<float> src_f = convert_from_asymmetric(src);
+ SimpleTensor<float> dst_f = reference::reduction_operation<float, float>(src_f, dst_shape, axis, op);
+ return convert_to_asymmetric<int8_t>(dst_f, src.quantization_info());
+ }
+ else
+ {
+ return compute_reduction_operation<int8_t, int8_t>(src, dst_shape, axis, op);
+ }
+}
+
template SimpleTensor<float> reduction_operation(const SimpleTensor<float> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op);
template SimpleTensor<half> reduction_operation(const SimpleTensor<half> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op);