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.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/runtime/CL/functions/CLReductionOperation.cpp b/src/runtime/CL/functions/CLReductionOperation.cpp
index 9f99d2db6f..2e48897323 100644
--- a/src/runtime/CL/functions/CLReductionOperation.cpp
+++ b/src/runtime/CL/functions/CLReductionOperation.cpp
@@ -105,6 +105,11 @@ Status CLReductionOperation::validate(const ITensorInfo *input, const ITensorInf
intermediate_kernel_op = ReductionOperation::PROD;
last_kernel_op = ReductionOperation::PROD;
break;
+ case ReductionOperation::MIN:
+ first_kernel_op = ReductionOperation::MIN;
+ intermediate_kernel_op = ReductionOperation::MIN;
+ last_kernel_op = ReductionOperation::MIN;
+ break;
default:
ARM_COMPUTE_ERROR("Not supported");
}
@@ -179,6 +184,33 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign
last_kernel_op = ReductionOperation::PROD;
pixelValue = PixelValue(1, input->info()->data_type());
break;
+ case ReductionOperation::MIN:
+ 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 = PixelValue(255, input->info()->data_type(), input->info()->quantization_info());
+ break;
+ }
+ default:
+ {
+ ARM_COMPUTE_ERROR("Unsupported DataType");
+ }
+ }
+ break;
default:
ARM_COMPUTE_ERROR("Not supported");
}