aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLSobel5x5.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-09-18 17:43:33 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit5701e2a41ddf0a12042ac648993fc39701961f66 (patch)
treedd66e82e7f7fdc30a636e748a774422bc1bec40d /src/runtime/CL/functions/CLSobel5x5.cpp
parente938175997b973e1ea288f5b95cc8710e6abc7aa (diff)
downloadComputeLibrary-5701e2a41ddf0a12042ac648993fc39701961f66.tar.gz
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 <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLSobel5x5.cpp')
-rw-r--r--src/runtime/CL/functions/CLSobel5x5.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/runtime/CL/functions/CLSobel5x5.cpp b/src/runtime/CL/functions/CLSobel5x5.cpp
index 098b546c1a..d4bc85524e 100644
--- a/src/runtime/CL/functions/CLSobel5x5.cpp
+++ b/src/runtime/CL/functions/CLSobel5x5.cpp
@@ -33,8 +33,8 @@
using namespace arm_compute;
-CLSobel5x5::CLSobel5x5()
- : _sobel_hor(), _sobel_vert(), _border_handler(), _tmp_x(), _tmp_y()
+CLSobel5x5::CLSobel5x5(std::shared_ptr<IMemoryManager> memory_manager)
+ : _memory_group(std::move(memory_manager)), _sobel_hor(), _sobel_vert(), _border_handler(), _tmp_x(), _tmp_y()
{
}
@@ -51,6 +51,8 @@ void CLSobel5x5::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *out
{
_tmp_x.allocator()->init(tensor_info);
_tmp_y.allocator()->init(tensor_info);
+ _memory_group.manage(&_tmp_x);
+ _memory_group.manage(&_tmp_y);
_sobel_hor.configure(input, &_tmp_x, &_tmp_y, border_mode == BorderMode::UNDEFINED);
_sobel_vert.configure(&_tmp_x, &_tmp_y, output_x, output_y, border_mode == BorderMode::UNDEFINED);
_tmp_x.allocator()->allocate();
@@ -59,6 +61,7 @@ void CLSobel5x5::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *out
else if(run_sobel_x)
{
_tmp_x.allocator()->init(tensor_info);
+ _memory_group.manage(&_tmp_x);
_sobel_hor.configure(input, &_tmp_x, nullptr, border_mode == BorderMode::UNDEFINED);
_sobel_vert.configure(&_tmp_x, nullptr, output_x, nullptr, border_mode == BorderMode::UNDEFINED);
_tmp_x.allocator()->allocate();
@@ -66,6 +69,7 @@ void CLSobel5x5::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *out
else if(run_sobel_y)
{
_tmp_y.allocator()->init(tensor_info);
+ _memory_group.manage(&_tmp_y);
_sobel_hor.configure(input, nullptr, &_tmp_y, border_mode == BorderMode::UNDEFINED);
_sobel_vert.configure(nullptr, &_tmp_y, nullptr, output_y, border_mode == BorderMode::UNDEFINED);
_tmp_y.allocator()->allocate();
@@ -76,6 +80,11 @@ void CLSobel5x5::configure(ICLTensor *input, ICLTensor *output_x, ICLTensor *out
void CLSobel5x5::run()
{
CLScheduler::get().enqueue(_border_handler, false);
+
+ _memory_group.acquire();
+
CLScheduler::get().enqueue(_sobel_hor, false);
CLScheduler::get().enqueue(_sobel_vert);
+
+ _memory_group.release();
}