From d05dce46a14a7b67f322328ecd95bf96bdd30bae Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 22 Jan 2018 16:29:17 +0000 Subject: COMPMID-791: Generic Depthwise Convolution Layer NEON QASYMM8 Change-Id: I33cf54e68f6c097ac58b6f16c3f9a720978f09cd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/117289 Tested-by: Jenkins Reviewed-by: Michalis Spyrou Reviewed-by: Anthony Barbier --- .../core/NEON/kernels/NEDepthwiseIm2ColKernel.h | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'arm_compute/core/NEON/kernels/NEDepthwiseIm2ColKernel.h') diff --git a/arm_compute/core/NEON/kernels/NEDepthwiseIm2ColKernel.h b/arm_compute/core/NEON/kernels/NEDepthwiseIm2ColKernel.h index 8d59ba3248..ca10bfaab2 100644 --- a/arm_compute/core/NEON/kernels/NEDepthwiseIm2ColKernel.h +++ b/arm_compute/core/NEON/kernels/NEDepthwiseIm2ColKernel.h @@ -55,7 +55,7 @@ public: /** Set the input and output of the kernel. * * @param[in] input The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], - * while every optional dimension from 4 and above represent a batch of inputs. Data types supported: F32 + * while every optional dimension from 4 and above represent a batch of inputs. Data types supported: QASYMM8, F32 * @param[out] output The output tensor. First 3 lower dimensions represent a transform of each 3D input, * while every dimension above 3 represents a batch. Data types supported: Same as @p input * @param[in] kernel_dims The kernel dimensions (width and height). @@ -68,11 +68,25 @@ public: void run(const Window &window, const ThreadInfo &info) override; private: - const ITensor *_input; - ITensor *_output; - Size2D _kernel_dims; - PadStrideInfo _conv_info; - bool _has_bias; + /** Template function to run the im2col used for the depthwise convolution layer case + * + * @param[in] window Region on which to execute the kernel. (Must be a valid region of the window returned by window()). + */ + template + void run_generic(const Window &window); + /** Common signature for all the specialised depthwise im2col functions + * + * @param[in] window Region on which to execute the kernel. + */ + using DepthwiseIm2ColFunctionPtr = void (NEDepthwiseIm2ColKernel::*)(const Window &window); + +private: + DepthwiseIm2ColFunctionPtr _func; + const ITensor *_input; + ITensor *_output; + Size2D _kernel_dims; + PadStrideInfo _conv_info; + bool _has_bias; }; } // arm_compute #endif /*__ARM_COMPUTE_NEDEPTHWISEIM2COLKERNEL_H__ */ -- cgit v1.2.1