From ebcebf1dee7f8314976b1e0cabd62b4cf893d765 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 21 Oct 2020 00:04:14 +0100 Subject: COMPMID-3638: Move NEON kernels Signed-off-by: Michalis Spyrou Change-Id: Ieed3e4bc8be7fef80c90c5094599b477a56fc473 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4285 Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- .../NEON/functions/NEGEMMConvolutionLayer.h | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h') diff --git a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h index b3f5c51010..6bcf56fb0b 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h @@ -26,10 +26,6 @@ #include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/NEON/kernels/NECol2ImKernel.h" -#include "arm_compute/core/NEON/kernels/NEGEMMTranspose1xWKernel.h" -#include "arm_compute/core/NEON/kernels/NEIm2ColKernel.h" -#include "arm_compute/core/NEON/kernels/NEWeightsReshapeKernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/IWeightsManager.h" #include "arm_compute/runtime/MemoryGroup.h" @@ -44,6 +40,9 @@ namespace arm_compute { class ITensor; +class NECol2ImKernel; +class NEIm2ColKernel; +class NEWeightsReshapeKernel; /** Function to reshape the weights. This function calls the following kernel: * -# @ref NEWeightsReshapeKernel @@ -61,6 +60,8 @@ public: NEConvolutionLayerReshapeWeights &operator=(const NEConvolutionLayerReshapeWeights &) = delete; /** Default move assignment operator */ NEConvolutionLayerReshapeWeights &operator=(NEConvolutionLayerReshapeWeights &&) = default; + /** Default destructor */ + ~NEConvolutionLayerReshapeWeights(); /** Set the input and output tensors. * * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. @@ -88,7 +89,7 @@ public: void run() override; private: - NEWeightsReshapeKernel _weights_reshape_kernel; + std::unique_ptr _weights_reshape_kernel; }; namespace weights_transformations @@ -97,6 +98,18 @@ namespace weights_transformations class NEConvolutionLayerReshapeWeightsTransform : public ITransformWeights { public: + /** Constructor */ + NEConvolutionLayerReshapeWeightsTransform() = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + NEConvolutionLayerReshapeWeightsTransform(const NEConvolutionLayerReshapeWeightsTransform &) = delete; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + NEConvolutionLayerReshapeWeightsTransform &operator=(const NEConvolutionLayerReshapeWeightsTransform &) = delete; + /** Prevent instances of this class from being moved (As this class contains non movable objects) */ + NEConvolutionLayerReshapeWeightsTransform(NEConvolutionLayerReshapeWeightsTransform &&) = delete; + /** Prevent instances of this class from being moved (As this class contains non movable objects) */ + NEConvolutionLayerReshapeWeightsTransform &operator=(NEConvolutionLayerReshapeWeightsTransform &&) = delete; + /** Default destructor */ + ~NEConvolutionLayerReshapeWeightsTransform() = default; void configure(const ITensor *input, const ITensor *biases) { _bias_bit = (biases != nullptr) ? 1 : 0; @@ -160,6 +173,8 @@ public: NEGEMMConvolutionLayer &operator=(const NEGEMMConvolutionLayer &) = delete; /** Default move assignment operator */ NEGEMMConvolutionLayer &operator=(NEGEMMConvolutionLayer &&) = default; + /** Default destructor */ + ~NEGEMMConvolutionLayer(); /** Set the input and output tensors. * * @param[in] input Source tensor. 3 lower dimensions represent a single input [width, height, IFM], @@ -253,10 +268,10 @@ private: IWeightsManager *_weights_manager; NEConvolutionLayerReshapeWeights _reshape_weights; weights_transformations::NEConvolutionLayerReshapeWeightsTransform _reshape_weights_managed; - NEIm2ColKernel _im2col_kernel; + std::unique_ptr _im2col_kernel; NEGEMM _mm_gemm; NEGEMMLowpMatrixMultiplyCore _mm_gemmlowp; - NECol2ImKernel _col2im_kernel; + std::unique_ptr _col2im_kernel; NEReshapeLayer _reshape_layer; const ITensor *_original_weights; -- cgit v1.2.1