From a2747487fbe7eb6d9f5357c6d16c32355ed6e01c Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Tue, 9 Feb 2021 10:28:54 +0000 Subject: MLCE-347 'REDUCE_MIN, REDUCE_MAX, REDUCE_SUM Support' * Added TfLiteParser support for REDUCE_MIN and REDUCE_MAX operators * Added ACL workloads support for REDUCE_MIN, REDUCE_MAX, and REDUCE_SUM operators * Added TfLite Delegate support for REDUCE_MIN, REDUCE_MAX, and REDUCE_SUM operators Signed-off-by: Sadik Armagan Change-Id: I8085d59946bfd4ab78a59a61f899031ae53371a8 --- src/backends/aclCommon/ArmComputeUtils.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/backends/aclCommon/ArmComputeUtils.hpp') diff --git a/src/backends/aclCommon/ArmComputeUtils.hpp b/src/backends/aclCommon/ArmComputeUtils.hpp index 2a0707872e..d9efab288f 100644 --- a/src/backends/aclCommon/ArmComputeUtils.hpp +++ b/src/backends/aclCommon/ArmComputeUtils.hpp @@ -255,4 +255,16 @@ inline unsigned int ComputePositiveAxis(const int& axis, const armnn::TensorInfo return static_cast(positiveAxis); } +inline arm_compute::ReductionOperation ConvertReductionOperationToAcl(const ReduceDescriptor& descriptor) +{ + switch (descriptor.m_ReduceOperation) + { + case ReduceOperation::Sum: return arm_compute::ReductionOperation::SUM; + case ReduceOperation::Mean: return arm_compute::ReductionOperation::MEAN_SUM; + case ReduceOperation::Max: return arm_compute::ReductionOperation::MAX; + case ReduceOperation::Min: return arm_compute::ReductionOperation::MIN; + default: throw InvalidArgumentException("Unsupported Reduction operation"); + } +} + } // namespace armnn -- cgit v1.2.1