From 9e9cbafa9e6cc6b543c89a96d52fc9c5fde04ceb Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 15 Mar 2018 14:41:34 +0000 Subject: COMPMID-1004 GLES: Add memory manager to GLES functions Change-Id: I80fc9c0dd02afd79b501abde751036f9599b7bf2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/125103 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp') diff --git a/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp b/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp index 5122c20504..46424a59f5 100644 --- a/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp +++ b/src/runtime/GLES_COMPUTE/functions/GCGEMM.cpp @@ -40,8 +40,8 @@ using namespace arm_compute; using namespace arm_compute::gles_compute; -GCGEMM::GCGEMM() - : _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _ma_kernel(), _tmp_a(), _tmp_b(), _is_interleaved_transposed(false), _run_addition(false) +GCGEMM::GCGEMM(std::shared_ptr memory_manager) + : _memory_group(std::move(memory_manager)), _interleave_kernel(), _transpose_kernel(), _mm_kernel(), _ma_kernel(), _tmp_a(), _tmp_b(), _is_interleaved_transposed(false), _run_addition(false) { } @@ -88,6 +88,7 @@ void GCGEMM::configure(const IGCTensor *a, const IGCTensor *b, const IGCTensor * TensorInfo info_a(shape_tmp_a, 1, a->info()->data_type(), a->info()->fixed_point_position()); _tmp_a.allocator()->init(info_a); + _memory_group.manage(&_tmp_a); TensorInfo info_b(shape_tmp_b, 1, b->info()->data_type(), b->info()->fixed_point_position()); _tmp_b.allocator()->init(info_b); @@ -118,6 +119,7 @@ void GCGEMM::configure(const IGCTensor *a, const IGCTensor *b, const IGCTensor * void GCGEMM::run() { + _memory_group.acquire(); if(_is_interleaved_transposed) { // Run interleave kernel @@ -137,4 +139,5 @@ void GCGEMM::run() GCScheduler::get().memory_barrier(); GCScheduler::get().dispatch(_ma_kernel); } + _memory_group.release(); } -- cgit v1.2.1