From 7e9391bb14d219cda310bff355669b5964b1f576 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 5 Oct 2018 14:49:28 +0100 Subject: COMPMID-1574 Implement ReduceMean in OpenCL Change-Id: Id331199f569f52a37280a9ada5bf84694580b93c Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/152843 Tested-by: bsgcomp Reviewed-by: Michele DiGiorgio --- arm_compute/core/CL/kernels/CLReductionOperationKernel.h | 14 ++++++++------ arm_compute/core/Types.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'arm_compute/core') diff --git a/arm_compute/core/CL/kernels/CLReductionOperationKernel.h b/arm_compute/core/CL/kernels/CLReductionOperationKernel.h index 60e2f08005..ef24fd5166 100644 --- a/arm_compute/core/CL/kernels/CLReductionOperationKernel.h +++ b/arm_compute/core/CL/kernels/CLReductionOperationKernel.h @@ -50,25 +50,27 @@ public: /** Set the input and output tensors. * - * @param[in] input Source tensor. Data types supported: F16/F32. Data layouts supported: NCHW. + * @param[in] input Source tensor. Data types supported: QASYMM8/F16/F32. Data layouts supported: NCHW. * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p input. * Output will have the same number of dimensions as input. - * @param[in] axis Axis along which to reduce. Supported reduction axis : 0 + * @param[in] axis Axis along which to reduce. Supported reduction axis : 0,1,2,3 * @param[in] op Reduction operation to perform. + * @param[in] width (Optional) In case of x-axis we also need to provide the width of the input image. */ - void configure(const ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op); + void configure(const ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, unsigned int width = 0); /** Static function to check if given info will lead to a valid configuration of @ref CLReductionOperationKernel. * - * @param[in] input Source tensor info. Data types supported: F16/F32. Data layouts supported: NCHW. + * @param[in] input Source tensor info. Data types supported: QASYMM8/F16/F32. Data layouts supported: NCHW. * @param[in] output Destination tensor info. Data types and data layouts supported: Same as @p input. * Output will have the same number of dimensions as input. - * @param[in] axis Axis along which to reduce. Supported reduction axis : 0 + * @param[in] axis Axis along which to reduce. Supported reduction axis : 0,1,2,3 * @param[in] op Reduction operation to perform. + * @param[in] width (Optional) In case of x-axis we also need to provide the width of the input image. * * @return a status */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op); + static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op, unsigned int width = 0); // Inherited methods overridden: void run(const Window &window, cl::CommandQueue &queue) override; diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 9b81eccafb..c0350bc7a4 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -522,6 +522,7 @@ enum class ReductionOperation { SUM_SQUARE, /**< Sum of squares */ SUM, /**< Sum */ + MEAN_SUM, /**< Mean of sum */ }; /** The normalization type used for the normalization layer */ -- cgit v1.2.1