aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLHOGDescriptor.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-09-15 19:06:47 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit8a94e7cec7b09a417a278425e2b56e7af5bf45d9 (patch)
treee952f39903d4624bbd6445c9cc6c7dbcc1114026 /src/runtime/CL/functions/CLHOGDescriptor.cpp
parent658039bc4e06be34272eccf559a516a6b52f75f5 (diff)
downloadComputeLibrary-8a94e7cec7b09a417a278425e2b56e7af5bf45d9.tar.gz
COMPMID-534: Add MemoryManager support in OpenCL functions
Adds support for: -CLConvolution -CLGEMM -CLGEMMLowp -CLHOGDescriptor -CLHOGGradient -CLHOGMultiDetection -CLL2Normalize -CLLocallyConnectedLayer -CLOpticalFlow -CLReductionOperation Change-Id: Ib13354d274ccf32ae933f3fbbad3ac3896cfd3bd Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87938 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLHOGDescriptor.cpp')
-rw-r--r--src/runtime/CL/functions/CLHOGDescriptor.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/runtime/CL/functions/CLHOGDescriptor.cpp b/src/runtime/CL/functions/CLHOGDescriptor.cpp
index b1b5a03ac1..1470d5cdc1 100644
--- a/src/runtime/CL/functions/CLHOGDescriptor.cpp
+++ b/src/runtime/CL/functions/CLHOGDescriptor.cpp
@@ -31,8 +31,8 @@
using namespace arm_compute;
-CLHOGDescriptor::CLHOGDescriptor()
- : _gradient(), _orient_bin(), _block_norm(), _mag(), _phase(), _hog_space()
+CLHOGDescriptor::CLHOGDescriptor(std::shared_ptr<IMemoryManager> memory_manager)
+ : _memory_group(std::move(memory_manager)), _gradient(), _orient_bin(), _block_norm(), _mag(), _phase(), _hog_space()
{
}
@@ -71,9 +71,16 @@ void CLHOGDescriptor::configure(ICLTensor *input, ICLTensor *output, const IHOG
TensorInfo info_space(shape_hog_space, num_bins, DataType::F32);
_hog_space.allocator()->init(info_space);
+ // Manage intermediate buffers
+ _memory_group.manage(&_mag);
+ _memory_group.manage(&_phase);
+
// Initialise gradient kernel
_gradient.configure(input, &_mag, &_phase, hog_info->phase_type(), border_mode, constant_border_value);
+ // Manage intermediate buffers
+ _memory_group.manage(&_hog_space);
+
// Initialise orientation binning kernel
_orient_bin.configure(&_mag, &_phase, &_hog_space, hog->info());
@@ -88,6 +95,8 @@ void CLHOGDescriptor::configure(ICLTensor *input, ICLTensor *output, const IHOG
void CLHOGDescriptor::run()
{
+ _memory_group.acquire();
+
// Run gradient
_gradient.run();
@@ -96,4 +105,6 @@ void CLHOGDescriptor::run()
// Run block normalization
CLScheduler::get().enqueue(_block_norm);
+
+ _memory_group.release();
} \ No newline at end of file