diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-01-30 18:11:13 +0000 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-02-07 15:17:57 +0000 |
commit | 0b18d9740f04cc4e9cb6000a76b9c1dcd8327e24 (patch) | |
tree | 8ffd0b1c676b13499314d3396818f0c30c1020f2 /src/runtime/CL | |
parent | c971cf1034a61875c8e8c87d48634cbfac3865fd (diff) | |
download | ComputeLibrary-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 'src/runtime/CL')
-rw-r--r-- | src/runtime/CL/functions/CLReduceMean.cpp | 6 | ||||
-rw-r--r-- | src/runtime/CL/functions/CLReductionOperation.cpp | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/runtime/CL/functions/CLReduceMean.cpp b/src/runtime/CL/functions/CLReduceMean.cpp index c5de43da35..9920617880 100644 --- a/src/runtime/CL/functions/CLReduceMean.cpp +++ b/src/runtime/CL/functions/CLReduceMean.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 ARM Limited. + * Copyright (c) 2018-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -28,9 +28,7 @@ #include "arm_compute/core/CL/kernels/CLReductionOperationKernel.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/Types.h" -#include "arm_compute/core/utils/helpers/tensor_transform.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" -#include "arm_compute/runtime/CL/CLScheduler.h" #include "support/ToolchainSupport.h" namespace arm_compute @@ -42,7 +40,7 @@ Status validate_config(const ITensorInfo *input, const Coordinates &reduction_ax ARM_COMPUTE_UNUSED(keep_dims); ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output); ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(input); - ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::F16, DataType::F32); + ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::F16, DataType::F32); ARM_COMPUTE_RETURN_ERROR_ON(reduction_axis.num_dimensions() < 1); ARM_COMPUTE_RETURN_ERROR_ON(reduction_axis.num_dimensions() > input->num_dimensions()); diff --git a/src/runtime/CL/functions/CLReductionOperation.cpp b/src/runtime/CL/functions/CLReductionOperation.cpp index 2f9a38601d..e04982a315 100644 --- a/src/runtime/CL/functions/CLReductionOperation.cpp +++ b/src/runtime/CL/functions/CLReductionOperation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -271,6 +271,11 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign pixelValue = PixelValue(255, input->info()->data_type(), input->info()->quantization_info()); break; } + case DataType::QASYMM8_SIGNED: + { + pixelValue = PixelValue(127, input->info()->data_type(), input->info()->quantization_info()); + break; + } default: { ARM_COMPUTE_ERROR("Unsupported DataType"); @@ -298,6 +303,11 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign pixelValue = PixelValue(0, input->info()->data_type(), input->info()->quantization_info()); break; } + case DataType::QASYMM8_SIGNED: + { + pixelValue = PixelValue(-128, input->info()->data_type(), input->info()->quantization_info()); + break; + } default: { ARM_COMPUTE_ERROR("Unsupported DataType"); |