From f6f7876e9ee8b58a8a6b335b032d554412fa3983 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Mon, 6 Jul 2020 11:27:21 +0100 Subject: COMPMID-3532: Align data type support between doxygen and implementation - CL Also removes some unused code. Change-Id: I85687c40999c3cdf9e6fccfcd020b0901a9515fe Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3581 Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/runtime/CL/functions/CLReductionOperation.cpp | 62 ++--------------------- 1 file changed, 3 insertions(+), 59 deletions(-) (limited to 'src/runtime/CL/functions/CLReductionOperation.cpp') diff --git a/src/runtime/CL/functions/CLReductionOperation.cpp b/src/runtime/CL/functions/CLReductionOperation.cpp index 4166c3230b..54e91fb8d8 100644 --- a/src/runtime/CL/functions/CLReductionOperation.cpp +++ b/src/runtime/CL/functions/CLReductionOperation.cpp @@ -24,22 +24,19 @@ #include "arm_compute/runtime/CL/functions/CLReductionOperation.h" #include "arm_compute/core/CL/ICLTensor.h" -#include "arm_compute/core/CL/kernels/CLReductionOperationKernel.h" -#include "arm_compute/core/Error.h" #include "arm_compute/core/Helpers.h" #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Validate.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/CL/CLScheduler.h" -#include "arm_compute/runtime/Tensor.h" #include "arm_compute/runtime/Utils.h" #include "support/MemorySupport.h" namespace arm_compute { CLReductionOperation::CLReductionOperation(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _results_vector(), _reduction_kernels_vector(), _border_handlers_vector(), _reshape(), _op(), _num_of_stages(), _reduction_axis(), _is_serial(), + : _memory_group(std::move(memory_manager)), _results_vector(), _reduction_kernels_vector(), _border_handlers_vector(), _reshape(), _num_of_stages(), _reduction_axis(), _is_serial(), _is_reshape_required(false) { } @@ -197,7 +194,6 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign void CLReductionOperation::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - _op = op; _num_of_stages = calculate_number_of_stages_only_x_axis(input->info()->dimension(0), axis); _reduction_axis = axis; _is_serial = needs_serialized_reduction(op, input->info()->data_type(), axis); @@ -259,65 +255,13 @@ void CLReductionOperation::configure(const CLCompileContext &compile_context, IC first_kernel_op = ReductionOperation::MIN; intermediate_kernel_op = ReductionOperation::MIN; last_kernel_op = ReductionOperation::MIN; - switch(input->info()->data_type()) - { - case DataType::F32: - { - pixelValue = PixelValue(std::numeric_limits::max()); - break; - } - case DataType::F16: - { - pixelValue = PixelValue(static_cast(65504.0f)); - break; - } - case DataType::QASYMM8: - { - pixelValue = std::get<1>(get_min_max(input->info()->data_type())); - break; - } - case DataType::QASYMM8_SIGNED: - { - pixelValue = PixelValue(127, input->info()->data_type(), input->info()->quantization_info()); - break; - } - default: - { - ARM_COMPUTE_ERROR("Unsupported DataType"); - } - } + pixelValue = std::get<1>(get_min_max(input->info()->data_type())); break; case ReductionOperation::MAX: first_kernel_op = ReductionOperation::MAX; intermediate_kernel_op = ReductionOperation::MAX; last_kernel_op = ReductionOperation::MAX; - switch(input->info()->data_type()) - { - case DataType::F32: - { - pixelValue = PixelValue(-std::numeric_limits::max()); - break; - } - case DataType::F16: - { - pixelValue = PixelValue(static_cast(-65504.0f)); - break; - } - case DataType::QASYMM8: - { - pixelValue = std::get<0>(get_min_max(input->info()->data_type())); - break; - } - case DataType::QASYMM8_SIGNED: - { - pixelValue = PixelValue(-128, input->info()->data_type(), input->info()->quantization_info()); - break; - } - default: - { - ARM_COMPUTE_ERROR("Unsupported DataType"); - } - } + pixelValue = std::get<0>(get_min_max(input->info()->data_type())); break; default: ARM_COMPUTE_ERROR("Not supported"); -- cgit v1.2.1