aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/NEON/functions/NEConvolution.h
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-10-21 00:04:14 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2020-11-03 15:10:47 +0000
commitebcebf1dee7f8314976b1e0cabd62b4cf893d765 (patch)
tree95d3e691a0e88a3e213a1d30446a9224497f2055 /arm_compute/runtime/NEON/functions/NEConvolution.h
parentda4b1b2055d96aaf73704eb9b0b82d74dc2d699c (diff)
downloadComputeLibrary-ebcebf1dee7f8314976b1e0cabd62b4cf893d765.tar.gz
COMPMID-3638: Move NEON kernels
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Change-Id: Ieed3e4bc8be7fef80c90c5094599b477a56fc473 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4285 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/NEON/functions/NEConvolution.h')
-rw-r--r--arm_compute/runtime/NEON/functions/NEConvolution.h59
1 files changed, 49 insertions, 10 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEConvolution.h b/arm_compute/runtime/NEON/functions/NEConvolution.h
index eb16a4582e..9415cf0835 100644
--- a/arm_compute/runtime/NEON/functions/NEConvolution.h
+++ b/arm_compute/runtime/NEON/functions/NEConvolution.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2019 Arm Limited.
+ * Copyright (c) 2016-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,8 +24,6 @@
#ifndef ARM_COMPUTE_NECONVOLUTION_H
#define ARM_COMPUTE_NECONVOLUTION_H
-#include "arm_compute/core/NEON/kernels/NEConvolutionKernel.h"
-#include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h"
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/IFunction.h"
#include "arm_compute/runtime/IMemoryManager.h"
@@ -39,6 +37,13 @@
namespace arm_compute
{
class ITensor;
+class NEFillBorderKernel;
+template <unsigned int matrix_size>
+class NEConvolutionKernel;
+template <unsigned int matrix_size>
+class NESeparableConvolutionHorKernel;
+template <unsigned int matrix_size>
+class NESeparableConvolutionVertKernel;
/** Basic function to execute convolution of size 3x3. This function calls the following NEON kernels:
*
@@ -49,6 +54,18 @@ class ITensor;
class NEConvolution3x3 : public INESimpleFunction
{
public:
+ /** Constructor */
+ NEConvolution3x3() = default;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolution3x3(const NEConvolution3x3 &) = delete;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolution3x3 &operator=(const NEConvolution3x3 &) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolution3x3(NEConvolution3x3 &&) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolution3x3 &operator=(NEConvolution3x3 &&) = delete;
+ /** Default destructor */
+ ~NEConvolution3x3();
/** Initialize the function's source, destination, conv and border_mode.
*
* @param[in,out] input Source tensor. Data type supported: U8. (Written to only for @p border_mode != UNDEFINED)
@@ -74,6 +91,16 @@ class NEConvolutionSquare : public IFunction
public:
/** Default constructor */
NEConvolutionSquare(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolutionSquare(const NEConvolutionSquare &) = delete;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolutionSquare &operator=(const NEConvolutionSquare &) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolutionSquare(NEConvolutionSquare &&) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolutionSquare &operator=(NEConvolutionSquare &&) = delete;
+ /** Default destructor */
+ ~NEConvolutionSquare();
/** Initialize the function's source, destination, conv and border_mode.
*
* @param[in,out] input Source tensor. Data type supported: U8. (Written to only for @p border_mode != UNDEFINED)
@@ -89,13 +116,13 @@ public:
void run() override;
private:
- MemoryGroup _memory_group; /**< Function memory group */
- Tensor _tmp; /**< temporary buffer for output of horizontal pass */
- bool _is_separable; /**< true if the convolution can be separated */
- NESeparableConvolutionHorKernel<matrix_size> _kernel_hor; /**< kernel for horizontal pass of separated convolution */
- NESeparableConvolutionVertKernel<matrix_size> _kernel_vert; /**< kernel for vertical pass of separated convolution */
- NEConvolutionKernel<matrix_size> _kernel; /**< kernel for non-separated convolution **/
- NEFillBorderKernel _border_handler; /**< kernel for border handling */
+ MemoryGroup _memory_group; /**< Function memory group */
+ Tensor _tmp; /**< temporary buffer for output of horizontal pass */
+ bool _is_separable; /**< true if the convolution can be separated */
+ std::unique_ptr<NESeparableConvolutionHorKernel<matrix_size>> _kernel_hor; /**< kernel for horizontal pass of separated convolution */
+ std::unique_ptr<NESeparableConvolutionVertKernel<matrix_size>> _kernel_vert; /**< kernel for vertical pass of separated convolution */
+ std::unique_ptr<NEConvolutionKernel<matrix_size>> _kernel; /**< kernel for non-separated convolution **/
+ std::unique_ptr<NEFillBorderKernel> _border_handler; /**< kernel for border handling */
};
/** Basic function to run 5x5 convolution. */
@@ -115,6 +142,18 @@ using NEConvolution9x9 = NEConvolutionSquare<9>;
class NEConvolutionRectangle : public INESimpleFunction
{
public:
+ /** Constructor */
+ NEConvolutionRectangle() = default;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolutionRectangle(const NEConvolutionRectangle &) = delete;
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ NEConvolutionRectangle &operator=(const NEConvolutionRectangle &) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolutionRectangle(NEConvolutionRectangle &&) = delete;
+ /** Prevent instances of this class from being moved (As this class contains non movable objects) */
+ NEConvolutionRectangle &operator=(NEConvolutionRectangle &&) = delete;
+ /** Default destructor */
+ ~NEConvolutionRectangle();
/** Initialize the function's source, destination, conv and border_mode.
*
* @param[in,out] input Source tensor. Data type supported: U8. (Written to only for @p border_mode != UNDEFINED)