From 5701e2a41ddf0a12042ac648993fc39701961f66 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 18 Sep 2017 17:43:33 +0100 Subject: COMPMID-534: Port MemoryManager to CL functions (Images) Adds support for: -CLCannyEdge -CLFastCorners -CLGaussian5x5 -CLHarrisCorners -CLSobel3x3 -CLSobel5x5 Change-Id: I712a76d4ceda915b5cf85a4d12c1b7a059d4d909 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88118 Tested-by: Kaizen Reviewed-by: Moritz Pflanzer Reviewed-by: Pablo Tello --- arm_compute/runtime/CL/functions/CLCannyEdge.h | 5 ++++- arm_compute/runtime/CL/functions/CLFastCorners.h | 6 +++++- arm_compute/runtime/CL/functions/CLGaussian5x5.h | 6 +++++- arm_compute/runtime/CL/functions/CLHarrisCorners.h | 6 ++++-- arm_compute/runtime/CL/functions/CLSobel5x5.h | 6 +++++- arm_compute/runtime/CL/functions/CLSobel7x7.h | 6 +++++- 6 files changed, 28 insertions(+), 7 deletions(-) (limited to 'arm_compute/runtime/CL/functions') diff --git a/arm_compute/runtime/CL/functions/CLCannyEdge.h b/arm_compute/runtime/CL/functions/CLCannyEdge.h index e5a82b2263..1d5a5aaeaa 100644 --- a/arm_compute/runtime/CL/functions/CLCannyEdge.h +++ b/arm_compute/runtime/CL/functions/CLCannyEdge.h @@ -28,7 +28,9 @@ #include "arm_compute/core/CL/kernels/CLCannyEdgeKernel.h" #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" +#include "arm_compute/runtime/IMemoryManager.h" #include @@ -49,7 +51,7 @@ class CLCannyEdge : public IFunction { public: /** Constructor */ - CLCannyEdge(); + CLCannyEdge(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destination, thresholds, gradient size, normalization type and border mode. * * @param[in,out] input Source tensor. Data types supported: U8. (Written to only for border_mode != UNDEFINED) @@ -68,6 +70,7 @@ public: virtual void run() override; private: + CLMemoryGroup _memory_group; /**< Function's memory group */ std::unique_ptr _sobel; /**< Pointer to Sobel kernel. */ CLGradientKernel _gradient; /**< Gradient kernel. */ CLFillBorderKernel _border_mag_gradient; /**< Fill border on magnitude tensor kernel */ diff --git a/arm_compute/runtime/CL/functions/CLFastCorners.h b/arm_compute/runtime/CL/functions/CLFastCorners.h index 79d82af462..9afec71bc3 100644 --- a/arm_compute/runtime/CL/functions/CLFastCorners.h +++ b/arm_compute/runtime/CL/functions/CLFastCorners.h @@ -29,11 +29,14 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Window.h" #include "arm_compute/runtime/CL/CLArray.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLNonMaximaSuppression3x3.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" #include +#include namespace arm_compute { @@ -51,7 +54,7 @@ class CLFastCorners : public IFunction { public: /** Constructor */ - CLFastCorners(); + CLFastCorners(std::shared_ptr memory_manager = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ CLFastCorners(const CLFastCorners &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -72,6 +75,7 @@ public: void run() override; private: + CLMemoryGroup _memory_group; CLFastCornersKernel _fast_corners_kernel; CLNonMaximaSuppression3x3 _suppr_func; CLCopyToArrayKernel _copy_array_kernel; diff --git a/arm_compute/runtime/CL/functions/CLGaussian5x5.h b/arm_compute/runtime/CL/functions/CLGaussian5x5.h index 148b9a9924..3c60cc66a3 100644 --- a/arm_compute/runtime/CL/functions/CLGaussian5x5.h +++ b/arm_compute/runtime/CL/functions/CLGaussian5x5.h @@ -27,10 +27,13 @@ #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/CL/kernels/CLGaussian5x5Kernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" #include +#include namespace arm_compute { @@ -47,7 +50,7 @@ class CLGaussian5x5 : public IFunction { public: /** Default Constructor. */ - CLGaussian5x5(); + CLGaussian5x5(std::shared_ptr memory_manager = nullptr); /** Initialise the function's source, destinations and border mode. * * @param[in,out] input Source tensor. Data types supported: U8. (Written to only for @p border_mode != UNDEFINED) @@ -61,6 +64,7 @@ public: void run() override; protected: + CLMemoryGroup _memory_group; /**< Function's memory group */ CLGaussian5x5HorKernel _kernel_hor; /**< Horizontal pass kernel */ CLGaussian5x5VertKernel _kernel_vert; /**< Vertical pass kernel */ CLFillBorderKernel _border_handler; /**< Kernel to handle image borders */ diff --git a/arm_compute/runtime/CL/functions/CLHarrisCorners.h b/arm_compute/runtime/CL/functions/CLHarrisCorners.h index f9a1275f68..e09e67060f 100644 --- a/arm_compute/runtime/CL/functions/CLHarrisCorners.h +++ b/arm_compute/runtime/CL/functions/CLHarrisCorners.h @@ -31,11 +31,12 @@ #include "arm_compute/core/CL/kernels/CLHarrisCornersKernel.h" #include "arm_compute/core/NEON/kernels/NEHarrisCornersKernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/functions/CLNonMaximaSuppression3x3.h" +#include "arm_compute/runtime/IMemoryManager.h" #include - #include namespace arm_compute @@ -60,7 +61,7 @@ class CLHarrisCorners : public IFunction { public: /** Constructor */ - CLHarrisCorners(); + CLHarrisCorners(std::shared_ptr memory_manager = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ CLHarrisCorners(const CLHarrisCorners &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -85,6 +86,7 @@ public: void run() override; private: + CLMemoryGroup _memory_group; /**< Function's memory group */ std::unique_ptr _sobel; /**< Sobel function */ CLHarrisScoreKernel _harris_score; /**< Harris score kernel */ CLNonMaximaSuppression3x3 _non_max_suppr; /**< Non-maxima suppression function */ diff --git a/arm_compute/runtime/CL/functions/CLSobel5x5.h b/arm_compute/runtime/CL/functions/CLSobel5x5.h index ad1f72faf8..3e603f8311 100644 --- a/arm_compute/runtime/CL/functions/CLSobel5x5.h +++ b/arm_compute/runtime/CL/functions/CLSobel5x5.h @@ -27,10 +27,13 @@ #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/CL/kernels/CLSobel5x5Kernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" #include +#include namespace arm_compute { @@ -47,7 +50,7 @@ class CLSobel5x5 : public IFunction { public: /** Default Constructor. */ - CLSobel5x5(); + CLSobel5x5(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. @@ -64,6 +67,7 @@ public: void run() override; protected: + CLMemoryGroup _memory_group; /**< Function's memory group */ CLSobel5x5HorKernel _sobel_hor; /**< Sobel Horizontal 5x5 kernel */ CLSobel5x5VertKernel _sobel_vert; /**< Sobel Vertical 5x5 kernel */ CLFillBorderKernel _border_handler; /**< Kernel to handle image borders */ diff --git a/arm_compute/runtime/CL/functions/CLSobel7x7.h b/arm_compute/runtime/CL/functions/CLSobel7x7.h index 1a3fe1a50a..0dc0a1c5e9 100644 --- a/arm_compute/runtime/CL/functions/CLSobel7x7.h +++ b/arm_compute/runtime/CL/functions/CLSobel7x7.h @@ -27,10 +27,13 @@ #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" #include "arm_compute/core/CL/kernels/CLSobel7x7Kernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" #include +#include namespace arm_compute { @@ -47,7 +50,7 @@ class CLSobel7x7 : public IFunction { public: /** Default Constructor. */ - CLSobel7x7(); + CLSobel7x7(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. @@ -64,6 +67,7 @@ public: void run() override; protected: + CLMemoryGroup _memory_group; /**< Function's memory group */ CLSobel7x7HorKernel _sobel_hor; /**< Sobel Horizontal 7x7 kernel */ CLSobel7x7VertKernel _sobel_vert; /**< Sobel Vertical 7x7 kernel */ CLFillBorderKernel _border_handler; /**< Kernel to handle image borders */ -- cgit v1.2.1