aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLGEMMLowp.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/CLGEMMLowp.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/CLGEMMLowp.cpp')
-rw-r--r--src/runtime/CL/functions/CLGEMMLowp.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/runtime/CL/functions/CLGEMMLowp.cpp b/src/runtime/CL/functions/CLGEMMLowp.cpp
index 45e011d8ce..db6d11c2c3 100644
--- a/src/runtime/CL/functions/CLGEMMLowp.cpp
+++ b/src/runtime/CL/functions/CLGEMMLowp.cpp
@@ -33,8 +33,8 @@
using namespace arm_compute;
-CLGEMMLowp::CLGEMMLowp()
- : _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _tmp_a(), _tmp_b()
+CLGEMMLowp::CLGEMMLowp(std::shared_ptr<IMemoryManager> memory_manager)
+ : _memory_group(std::move(memory_manager)), _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _tmp_a(), _tmp_b()
{
}
@@ -62,6 +62,10 @@ void CLGEMMLowp::configure(const ICLTensor *a, const ICLTensor *b, ICLTensor *ou
TensorInfo info_b(shape_tmp_b, 1, b->info()->data_type());
_tmp_b.allocator()->init(info_b);
+ // Manage intermediate buffers
+ _memory_group.manage(&_tmp_a);
+ _memory_group.manage(&_tmp_b);
+
// Configure kernels
_interleave_kernel.configure(a, &_tmp_a);
_transpose_kernel.configure(b, &_tmp_b);
@@ -74,6 +78,8 @@ void CLGEMMLowp::configure(const ICLTensor *a, const ICLTensor *b, ICLTensor *ou
void CLGEMMLowp::run()
{
+ _memory_group.acquire();
+
/* Run interleave kernel */
CLScheduler::get().enqueue(_interleave_kernel, false);
@@ -82,4 +88,6 @@ void CLGEMMLowp::run()
/* Run matrix multiply kernel */
CLScheduler::get().enqueue(_mm_kernel, false);
+
+ _memory_group.release();
}