aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLReductionOperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/CL/functions/CLReductionOperation.cpp')
-rw-r--r--src/runtime/CL/functions/CLReductionOperation.cpp62
1 files changed, 3 insertions, 59 deletions
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<IMemoryManager> 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<float>::max());
- break;
- }
- case DataType::F16:
- {
- pixelValue = PixelValue(static_cast<half>(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<float>::max());
- break;
- }
- case DataType::F16:
- {
- pixelValue = PixelValue(static_cast<half>(-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");