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/GCNormalizationLayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp') diff --git a/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp index fc3882dbda..13213d2b54 100644 --- a/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp +++ b/src/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -33,8 +33,8 @@ using namespace arm_compute; -GCNormalizationLayer::GCNormalizationLayer() - : _squared_input(), _norm_kernel(), _multiply_kernel(), _border_handler() +GCNormalizationLayer::GCNormalizationLayer(std::shared_ptr memory_manager) + : _memory_group(std::move(memory_manager)), _squared_input(), _norm_kernel(), _multiply_kernel(), _border_handler() { } @@ -43,6 +43,7 @@ void GCNormalizationLayer::configure(const IGCTensor *input, IGCTensor *output, ARM_COMPUTE_ERROR_ON(input == nullptr); _squared_input.allocator()->init(TensorInfo(input->info()->tensor_shape(), 1, input->info()->data_type())); + _memory_group.manage(&_squared_input); _norm_kernel.configure(input, &_squared_input, output, norm_info); _multiply_kernel.configure(input, input, &_squared_input, 1.0f); @@ -55,9 +56,11 @@ void GCNormalizationLayer::configure(const IGCTensor *input, IGCTensor *output, void GCNormalizationLayer::run() { + _memory_group.acquire(); GCScheduler::get().dispatch(_multiply_kernel, false); GCScheduler::get().memory_barrier(); GCScheduler::get().dispatch(_border_handler, false); GCScheduler::get().memory_barrier(); GCScheduler::get().dispatch(_norm_kernel, true); + _memory_group.release(); } -- cgit v1.2.1