From 658039bc4e06be34272eccf559a516a6b52f75f5 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 15 Sep 2017 16:30:50 +0100 Subject: COMPMID-534: Add MemoryManager support in NEON functions Adds support for: -NECannyEdge -NEConvolution -NEDirectConvolution -NEGEMM -NEGEMMLowp -NEGaussian5x5 -NEHOGDescriptor -NEHOGGradient -NEL2Normalize -NELocallyConnectedLayer -NENormalizationLayer -NEScale -NESobel5x5 -NESobel7x7 Change-Id: I68e05aa6054372fa873a882633a15fb97882c00d Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87926 Reviewed-by: Pablo Tello Tested-by: Kaizen --- arm_compute/runtime/NEON/functions/NECannyEdge.h | 5 ++++- arm_compute/runtime/NEON/functions/NEConvolution.h | 6 +++++- .../NEON/functions/NEDirectConvolutionLayer.h | 7 ++++++- arm_compute/runtime/NEON/functions/NEGEMM.h | 7 ++++++- arm_compute/runtime/NEON/functions/NEGEMMLowp.h | 7 ++++++- arm_compute/runtime/NEON/functions/NEGaussian5x5.h | 6 +++++- .../runtime/NEON/functions/NEHOGDescriptor.h | 7 ++++++- arm_compute/runtime/NEON/functions/NEHOGGradient.h | 5 ++++- .../runtime/NEON/functions/NEHOGMultiDetection.h | 7 ++++++- arm_compute/runtime/NEON/functions/NEL2Normalize.h | 7 ++++++- .../NEON/functions/NELocallyConnectedLayer.h | 7 ++++++- .../runtime/NEON/functions/NENormalizationLayer.h | 8 ++++++-- arm_compute/runtime/NEON/functions/NEOpticalFlow.h | 5 ++++- arm_compute/runtime/NEON/functions/NEScale.h | 23 ++++++++++++++++------ arm_compute/runtime/NEON/functions/NESobel5x5.h | 6 +++++- arm_compute/runtime/NEON/functions/NESobel7x7.h | 6 +++++- 16 files changed, 97 insertions(+), 22 deletions(-) (limited to 'arm_compute/runtime') diff --git a/arm_compute/runtime/NEON/functions/NECannyEdge.h b/arm_compute/runtime/NEON/functions/NECannyEdge.h index fbf2d90740..b7e0ffbcf1 100644 --- a/arm_compute/runtime/NEON/functions/NECannyEdge.h +++ b/arm_compute/runtime/NEON/functions/NECannyEdge.h @@ -28,6 +28,8 @@ #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" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" #include @@ -55,7 +57,7 @@ public: * * Initialize Sobel kernel to nullptr. */ - NECannyEdge(); + NECannyEdge(std::shared_ptr memory_manager = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ NECannyEdge(const NECannyEdge &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -80,6 +82,7 @@ public: void run() override; private: + MemoryGroup _memory_group; /**< Function's memory group */ std::unique_ptr _sobel; /**< Pointer to Sobel kernel */ std::unique_ptr _gradient; /**< Gradient kernel */ NEEdgeNonMaxSuppressionKernel _non_max_suppr; /**< Non-Maxima suppression kernel */ diff --git a/arm_compute/runtime/NEON/functions/NEConvolution.h b/arm_compute/runtime/NEON/functions/NEConvolution.h index 1704d9fa94..9c0a906651 100644 --- a/arm_compute/runtime/NEON/functions/NEConvolution.h +++ b/arm_compute/runtime/NEON/functions/NEConvolution.h @@ -28,10 +28,13 @@ #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" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/INESimpleFunction.h" #include "arm_compute/runtime/Tensor.h" #include +#include namespace arm_compute { @@ -70,7 +73,7 @@ class NEConvolutionSquare : public IFunction { public: /** Default constructor */ - NEConvolutionSquare(); + NEConvolutionSquare(std::shared_ptr memory_manager = nullptr); /** 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) @@ -86,6 +89,7 @@ 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 _kernel_hor; /**< kernel for horizontal pass of separated convolution */ diff --git a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h index 9d2775ada6..daaf18f297 100644 --- a/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h +++ b/arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h @@ -29,8 +29,12 @@ #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" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { /** Function to run the direct convolution. @@ -45,7 +49,7 @@ class NEDirectConvolutionLayer : public IFunction { public: /** Constructor */ - NEDirectConvolutionLayer(); + NEDirectConvolutionLayer(std::shared_ptr memory_manager = nullptr); /** Set the input, weights, biases and output tensors. * * @note: DirectConvolution only works in the following configurations: @@ -69,6 +73,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEDirectConvolutionLayerBiasAccumulateKernel _accumulate_bias_kernel; NEDirectConvolutionLayerKernel _conv_kernel; NEFillBorderKernel _input_border_handler; diff --git a/arm_compute/runtime/NEON/functions/NEGEMM.h b/arm_compute/runtime/NEON/functions/NEGEMM.h index 3c8d7cf9b7..b4b9e8be01 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMM.h +++ b/arm_compute/runtime/NEON/functions/NEGEMM.h @@ -30,8 +30,12 @@ #include "arm_compute/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.h" #include "arm_compute/core/NEON/kernels/NEGEMMTranspose1xWKernel.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { /** Basic function to execute GEMM on NEON. This function calls the following NEON kernels: @@ -46,7 +50,7 @@ class NEGEMM : public IFunction { public: /** Constructor */ - NEGEMM(); + NEGEMM(std::shared_ptr memory_manager = nullptr); /** Initialise the kernel's inputs, output * * @note GEMM: General Matrix Multiply - [alpha * A * B + beta * C]. @@ -65,6 +69,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEGEMMInterleave4x4Kernel _interleave_kernel; NEGEMMTranspose1xWKernel _transpose_kernel; NEGEMMMatrixMultiplyKernel _mm_kernel; diff --git a/arm_compute/runtime/NEON/functions/NEGEMMLowp.h b/arm_compute/runtime/NEON/functions/NEGEMMLowp.h index bfb1a494b8..0b0a7742f6 100644 --- a/arm_compute/runtime/NEON/functions/NEGEMMLowp.h +++ b/arm_compute/runtime/NEON/functions/NEGEMMLowp.h @@ -32,6 +32,10 @@ #include "arm_compute/core/NEON/kernels/NEGEMMInterleave4x4Kernel.h" #include "arm_compute/core/NEON/kernels/NEGEMMLowpMatrixMultiplyKernel.h" #include "arm_compute/core/NEON/kernels/NEGEMMTranspose1xWKernel.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" + +#include namespace arm_compute { @@ -48,7 +52,7 @@ class NEGEMMLowp : public IFunction { public: /** Constructor */ - NEGEMMLowp(); + NEGEMMLowp(std::shared_ptr memory_manager = nullptr); /** Initialise the kernel's inputs, output * * @note GEMM_LOWP: low precision GEMM kernel @@ -75,6 +79,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEGEMMInterleave4x4Kernel _interleave_kernel; NEGEMMTranspose1xWKernel _transpose_kernel; NEGEMMLowpMatrixMultiplyKernel _mm_kernel; diff --git a/arm_compute/runtime/NEON/functions/NEGaussian5x5.h b/arm_compute/runtime/NEON/functions/NEGaussian5x5.h index 699e42efb4..2aae3cb513 100644 --- a/arm_compute/runtime/NEON/functions/NEGaussian5x5.h +++ b/arm_compute/runtime/NEON/functions/NEGaussian5x5.h @@ -28,9 +28,12 @@ #include "arm_compute/core/NEON/kernels/NEGaussian5x5Kernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" #include +#include namespace arm_compute { @@ -48,7 +51,7 @@ class NEGaussian5x5 : public IFunction public: /** Default constructor */ - NEGaussian5x5(); + NEGaussian5x5(std::shared_ptr memory_manager = nullptr); /** Initialise the function's input, output and border mode. * * @param[in, out] input Source tensor. Data type supported: U8. (Written to only for @p border_mode != UNDEFINED) @@ -62,6 +65,7 @@ public: void run() override; protected: + MemoryGroup _memory_group; /**< Function memory group */ NEGaussian5x5HorKernel _kernel_hor; /**< kernel for horizontal pass */ NEGaussian5x5VertKernel _kernel_vert; /**< kernel for vertical pass */ Tensor _tmp; /**< temporary buffer for output of horizontal pass */ diff --git a/arm_compute/runtime/NEON/functions/NEHOGDescriptor.h b/arm_compute/runtime/NEON/functions/NEHOGDescriptor.h index b7b4909060..30989568e1 100644 --- a/arm_compute/runtime/NEON/functions/NEHOGDescriptor.h +++ b/arm_compute/runtime/NEON/functions/NEHOGDescriptor.h @@ -26,9 +26,13 @@ #include "arm_compute/core/NEON/kernels/NEHOGDescriptorKernel.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEHOGGradient.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { class IHOG; @@ -43,7 +47,7 @@ class NEHOGDescriptor : public IFunction { public: /** Default constructor */ - NEHOGDescriptor(); + NEHOGDescriptor(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destination, HOG data-object and border mode * * @param[in, out] input Input tensor. Data type supported: U8 @@ -59,6 +63,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEHOGGradient _gradient; NEHOGOrientationBinningKernel _orient_bin; NEHOGBlockNormalizationKernel _block_norm; diff --git a/arm_compute/runtime/NEON/functions/NEHOGGradient.h b/arm_compute/runtime/NEON/functions/NEHOGGradient.h index dd2d99adfe..7e268411e1 100644 --- a/arm_compute/runtime/NEON/functions/NEHOGGradient.h +++ b/arm_compute/runtime/NEON/functions/NEHOGGradient.h @@ -27,6 +27,8 @@ #include "arm_compute/core/NEON/INEKernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEDerivative.h" #include "arm_compute/runtime/Tensor.h" @@ -46,7 +48,7 @@ class NEHOGGradient : public IFunction { public: /** Default constructor */ - NEHOGGradient(); + NEHOGGradient(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destinations, phase type and border mode * * @param[in, out] input Input tensor. Data type supported: U8. @@ -63,6 +65,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEDerivative _derivative; std::unique_ptr _mag_phase; Tensor _gx; diff --git a/arm_compute/runtime/NEON/functions/NEHOGMultiDetection.h b/arm_compute/runtime/NEON/functions/NEHOGMultiDetection.h index 2d07e6435f..0d268ca565 100644 --- a/arm_compute/runtime/NEON/functions/NEHOGMultiDetection.h +++ b/arm_compute/runtime/NEON/functions/NEHOGMultiDetection.h @@ -29,10 +29,14 @@ #include "arm_compute/core/IMultiHOG.h" #include "arm_compute/core/NEON/kernels/NEHOGDescriptorKernel.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEHOGDetector.h" #include "arm_compute/runtime/NEON/functions/NEHOGGradient.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { /** Basic function to detect multiple objects (or the same object at different scales) on the same input image using HOG. This function calls the following NEON kernels: @@ -53,7 +57,7 @@ class NEHOGMultiDetection : public IFunction { public: /** Default constructor */ - NEHOGMultiDetection(); + NEHOGMultiDetection(std::shared_ptr memory_manager = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ NEHOGMultiDetection(const NEHOGMultiDetection &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -85,6 +89,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEHOGGradient _gradient_kernel; std::unique_ptr _orient_bin_kernel; std::unique_ptr _block_norm_kernel; diff --git a/arm_compute/runtime/NEON/functions/NEL2Normalize.h b/arm_compute/runtime/NEON/functions/NEL2Normalize.h index 1297b99e79..95d5186c13 100644 --- a/arm_compute/runtime/NEON/functions/NEL2Normalize.h +++ b/arm_compute/runtime/NEON/functions/NEL2Normalize.h @@ -26,9 +26,13 @@ #include "arm_compute/core/NEON/kernels/NEL2NormalizeKernel.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEReductionOperation.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { class ITensor; @@ -43,7 +47,7 @@ class NEL2Normalize : public IFunction { public: /** Constructor */ - NEL2Normalize(); + NEL2Normalize(std::shared_ptr memory_manager = nullptr); /** Set the input and output tensors. * * @param[in, out] input Source tensor. Data types supported: F32. (Written to only for border_size != 0) @@ -57,6 +61,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEReductionOperation _reduce_func; NEL2NormalizeKernel _normalize_kernel; Tensor _sumsq; diff --git a/arm_compute/runtime/NEON/functions/NELocallyConnectedLayer.h b/arm_compute/runtime/NEON/functions/NELocallyConnectedLayer.h index efb2ff6c8b..18d2a1dfb5 100644 --- a/arm_compute/runtime/NEON/functions/NELocallyConnectedLayer.h +++ b/arm_compute/runtime/NEON/functions/NELocallyConnectedLayer.h @@ -31,8 +31,12 @@ #include "arm_compute/core/NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.h" #include "arm_compute/core/NEON/kernels/NEWeightsReshapeKernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" +#include + namespace arm_compute { class INETensor; @@ -48,7 +52,7 @@ class NELocallyConnectedLayer : public IFunction { public: /** Default constructor */ - NELocallyConnectedLayer(); + NELocallyConnectedLayer(std::shared_ptr memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] input Source tensor. 3 lower dimensions represent a single input [width, height, IFM], @@ -66,6 +70,7 @@ public: void run() override; private: + MemoryGroup _memory_group; NEIm2ColKernel _input_im2col_kernel; NEWeightsReshapeKernel _weights_reshape_kernel; NELocallyConnectedMatrixMultiplyKernel _mm_kernel; diff --git a/arm_compute/runtime/NEON/functions/NENormalizationLayer.h b/arm_compute/runtime/NEON/functions/NENormalizationLayer.h index 4cfea226f3..1c95c5bc4a 100644 --- a/arm_compute/runtime/NEON/functions/NENormalizationLayer.h +++ b/arm_compute/runtime/NEON/functions/NENormalizationLayer.h @@ -29,9 +29,12 @@ #include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" #include "arm_compute/core/NEON/kernels/NENormalizationLayerKernel.h" #include "arm_compute/core/NEON/kernels/NEPixelWiseMultiplicationKernel.h" +#include "arm_compute/core/Types.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" -#include "arm_compute/core/Types.h" +#include namespace arm_compute { @@ -48,7 +51,7 @@ class NENormalizationLayer : public IFunction { public: /** Default constructor */ - NENormalizationLayer(); + NENormalizationLayer(std::shared_ptr memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] input Source tensor. 3 lower dims represent a single input with dimensions [width, height, IFM], @@ -62,6 +65,7 @@ public: void run() override; private: + MemoryGroup _memory_group; /**< Function memory group */ NENormalizationLayerKernel _norm_kernel; /**< Normalization layer kernel */ NEPixelWiseMultiplicationKernel _multiply_kernel; /**< Pixel multiplication kernel */ NEFillBorderKernel _border_handler; /**< Kernel to handle borders */ diff --git a/arm_compute/runtime/NEON/functions/NEOpticalFlow.h b/arm_compute/runtime/NEON/functions/NEOpticalFlow.h index 0534551d19..5d1fbe3a22 100644 --- a/arm_compute/runtime/NEON/functions/NEOpticalFlow.h +++ b/arm_compute/runtime/NEON/functions/NEOpticalFlow.h @@ -29,6 +29,8 @@ #include "arm_compute/core/Types.h" #include "arm_compute/runtime/Array.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/NEON/functions/NEScharr3x3.h" #include "arm_compute/runtime/Tensor.h" @@ -51,7 +53,7 @@ class NEOpticalFlow : public IFunction { public: /** Constructor */ - NEOpticalFlow(); + NEOpticalFlow(std::shared_ptr memory_manager = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ NEOpticalFlow(const NEOpticalFlow &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -80,6 +82,7 @@ public: void run() override; private: + MemoryGroup _memory_group; std::unique_ptr _func_scharr; std::unique_ptr _kernel_tracker; std::unique_ptr _scharr_gx; diff --git a/arm_compute/runtime/NEON/functions/NEScale.h b/arm_compute/runtime/NEON/functions/NEScale.h index e1da891dcf..91cda066e7 100644 --- a/arm_compute/runtime/NEON/functions/NEScale.h +++ b/arm_compute/runtime/NEON/functions/NEScale.h @@ -24,25 +24,30 @@ #ifndef __ARM_COMPUTE_NESCALEIMAGE_H__ #define __ARM_COMPUTE_NESCALEIMAGE_H__ +#include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" +#include "arm_compute/core/NEON/kernels/NEScaleKernel.h" #include "arm_compute/core/Types.h" -#include "arm_compute/runtime/NEON/INESimpleFunction.h" +#include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" #include +#include namespace arm_compute { class ITensor; /** Basic function to run @ref NEScaleKernel */ -class NEScale : public INESimpleFunction +class NEScale : public IFunction { public: /** Constructor * * Initialize NEScale */ - NEScale(); + NEScale(std::shared_ptr memory_manager = nullptr); /** Initialize the function's source, destination, interpolation type and border_mode. * * @param[in, out] input Source tensor. Data type supported: U8. (Written to only for @p border_mode != UNDEFINED) @@ -53,10 +58,16 @@ public: */ void configure(ITensor *input, ITensor *output, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value = 0); + // Inherited methods overridden: + void run() override; + private: - Tensor _offsets; /**< Offset to access the element with NEAREST interpolation or the top-left element with BILINEAR interpolation in the input tensor */ - Tensor _dx; /**< Element's distance between the X real coordinate and the smallest X following integer */ - Tensor _dy; /**< Element's distance between the Y real coordinate and the smallest Y following integer */ + MemoryGroup _memory_group; /**< Function memory group */ + Tensor _offsets; /**< Offset to access the element with NEAREST interpolation or the top-left element with BILINEAR interpolation in the input tensor */ + Tensor _dx; /**< Element's distance between the X real coordinate and the smallest X following integer */ + Tensor _dy; /**< Element's distance between the Y real coordinate and the smallest Y following integer */ + NEScaleKernel _scale_kernel; /**< Kernel to perform the scaling */ + NEFillBorderKernel _border_handler; /**< kernel to handle tensor borders */ }; } #endif /*__ARM_COMPUTE_NESCALEIMAGE_H__ */ diff --git a/arm_compute/runtime/NEON/functions/NESobel5x5.h b/arm_compute/runtime/NEON/functions/NESobel5x5.h index fc4d665a70..2b7cb70f15 100644 --- a/arm_compute/runtime/NEON/functions/NESobel5x5.h +++ b/arm_compute/runtime/NEON/functions/NESobel5x5.h @@ -28,9 +28,12 @@ #include "arm_compute/core/NEON/kernels/NESobel5x5Kernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" #include +#include namespace arm_compute { @@ -47,7 +50,7 @@ class NESobel5x5 : public IFunction { public: /** Default constructor */ - NESobel5x5(); + NESobel5x5(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destinations and border mode. * * @note At least one of output_x or output_y must be not NULL. @@ -65,6 +68,7 @@ public: void run() override; protected: + MemoryGroup _memory_group; /**< Function memory group */ NESobel5x5HorKernel _sobel_hor; /**< Sobel Horizontal 5x5 kernel */ NESobel5x5VertKernel _sobel_vert; /**< Sobel Vertical 5x5 kernel */ Tensor _tmp_x; /**< Temporary buffer for Sobel X */ diff --git a/arm_compute/runtime/NEON/functions/NESobel7x7.h b/arm_compute/runtime/NEON/functions/NESobel7x7.h index 06b7c80ad6..5f7bab7cfd 100644 --- a/arm_compute/runtime/NEON/functions/NESobel7x7.h +++ b/arm_compute/runtime/NEON/functions/NESobel7x7.h @@ -28,9 +28,12 @@ #include "arm_compute/core/NEON/kernels/NESobel7x7Kernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/runtime/Tensor.h" #include +#include namespace arm_compute { @@ -47,7 +50,7 @@ class NESobel7x7 : public IFunction { public: /** Default constructor */ - NESobel7x7(); + NESobel7x7(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destinations and border mode. * * @note At least one of output_x or output_y must be not NULL. @@ -65,6 +68,7 @@ public: void run() override; protected: + MemoryGroup _memory_group; /**< Function memory group */ NESobel7x7HorKernel _sobel_hor; /**< Sobel Horizontal 7x7 kernel */ NESobel7x7VertKernel _sobel_vert; /**< Sobel Vertical 7x7 kernel */ Tensor _tmp_x; /**< Temporary buffer for Sobel X */ -- cgit v1.2.1