From 1682430e220eb609752c650f85c0f96e375b6d6a Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 28 Sep 2017 15:41:37 +0100 Subject: COMPMID-463 - Extended Pooling Layer on NEON to support Global Pooling Change-Id: I8ae44187624deeab3d40d878e7b34ff651f1dad0 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89834 Reviewed-by: Georgios Pinitas Tested-by: Kaizen --- arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h | 9 +++++++++ arm_compute/runtime/NEON/functions/NEPoolingLayer.h | 18 ++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'arm_compute') diff --git a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h index 2a0ecf8ba7..9d7c75179a 100644 --- a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h +++ b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h @@ -47,6 +47,8 @@ public: /** Default destructor */ ~NEPoolingLayerKernel() = default; /** Set the input and output tensors. + * + * @note QS8, QS16 and F16 are supported for pool sizes 2 and 3 only * * @param[in] input Source tensor. Data types supported: QS8/QS16/F16/F32. * @param[out] output Destination tensor. Data types supported: Same as @p input. @@ -123,6 +125,13 @@ private: */ template void pooling7_f32(const Window &window_input, const Window &window); + /** Function to perform NxN pooling. + * + * @param[in] window_input Input region on which to execute the kernel. + * @param[in] window Output region on which to execute the kernel. + */ + template + void poolingN_f32(const Window &window_input, const Window &window); /** Common signature for all the specialised Pooling functions * * @param[in] window_input Input region on which to execute the kernel. diff --git a/arm_compute/runtime/NEON/functions/NEPoolingLayer.h b/arm_compute/runtime/NEON/functions/NEPoolingLayer.h index 5c36e80f37..7b038aaa51 100644 --- a/arm_compute/runtime/NEON/functions/NEPoolingLayer.h +++ b/arm_compute/runtime/NEON/functions/NEPoolingLayer.h @@ -24,8 +24,10 @@ #ifndef __ARM_COMPUTE_NEPOOLINGLAYER_H__ #define __ARM_COMPUTE_NEPOOLINGLAYER_H__ -#include "arm_compute/runtime/NEON/INESimpleFunction.h" +#include "arm_compute/runtime/IFunction.h" +#include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" +#include "arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h" #include "arm_compute/core/Types.h" namespace arm_compute @@ -37,16 +39,28 @@ class ITensor; * -# @ref NEFillBorderKernel (executed if padding size is different from zero) * -# @ref NEPoolingLayerKernel */ -class NEPoolingLayer : public INESimpleFunction +class NEPoolingLayer : public IFunction { public: + /** Constructor */ + NEPoolingLayer(); /** Set the input and output tensors. + * + * @note QS8, QS16 and F16 are supported for pool sizes 2 and 3 only * * @param[in, out] input Source tensor. (Written to only when padding != 0) Data types supported: QS8/QS16/F16/F32. * @param[out] output Destination tensor. Data types supported: Same as @p input. * @param[in] pool_info Contains pooling operation information described in @ref PoolingLayerInfo. */ void configure(ITensor *input, ITensor *output, const PoolingLayerInfo &pool_info); + + // Inherited methods overridden: + void run() override; + +private: + NEPoolingLayerKernel _pooling_layer_kernel; + NEFillBorderKernel _border_handler; + bool _is_global_pooling_layer; }; } #endif /* __ARM_COMPUTE_NEPOOLINGLAYER_H__ */ -- cgit v1.2.1