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 --- src/runtime/CL/functions/CLFastCorners.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/runtime/CL/functions/CLFastCorners.cpp') diff --git a/src/runtime/CL/functions/CLFastCorners.cpp b/src/runtime/CL/functions/CLFastCorners.cpp index d2903fb849..7a0dd09fbe 100644 --- a/src/runtime/CL/functions/CLFastCorners.cpp +++ b/src/runtime/CL/functions/CLFastCorners.cpp @@ -36,8 +36,9 @@ using namespace arm_compute; -CLFastCorners::CLFastCorners() - : _fast_corners_kernel(), +CLFastCorners::CLFastCorners(std::shared_ptr memory_manager) + : _memory_group(std::move(memory_manager)), + _fast_corners_kernel(), _suppr_func(), _copy_array_kernel(), _output(), @@ -70,6 +71,7 @@ void CLFastCorners::configure(const ICLImage *input, float threshold, bool nonma const bool update_number = (nullptr != _num_corners); + _memory_group.manage(&_output); _fast_corners_kernel.configure(input, &_output, threshold, nonmax_suppression, border_mode); if(!_non_max) @@ -79,6 +81,7 @@ void CLFastCorners::configure(const ICLImage *input, float threshold, bool nonma else { _suppr.allocator()->init(tensor_info); + _memory_group.manage(&_suppr); _suppr_func.configure(&_output, &_suppr, border_mode); _copy_array_kernel.configure(&_suppr, update_number, corners, &_num_buffer); @@ -94,6 +97,8 @@ void CLFastCorners::run() { cl::CommandQueue q = CLScheduler::get().queue(); + _memory_group.acquire(); + if(_non_max) { ARM_COMPUTE_ERROR_ON_MSG(_output.cl_buffer().get() == nullptr, "Unconfigured function"); @@ -124,4 +129,6 @@ void CLFastCorners::run() } q.flush(); + + _memory_group.release(); } -- cgit v1.2.1