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/GCFullyConnectedLayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp') diff --git a/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp b/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp index 9e4f0f6c95..0f8f8e6c94 100644 --- a/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp +++ b/src/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.cpp @@ -38,9 +38,9 @@ void GCFullyConnectedLayerReshapeWeights::configure(const IGCTensor *input, IGCT _kernel = std::move(k); } -GCFullyConnectedLayer::GCFullyConnectedLayer() - : _im2col_kernel(), _reshape_weights_kernel(), _mm_kernel(), _accumulate_biases_kernel(), _im2col_output(), _reshape_weights_output(), _are_weights_reshaped(true), _is_fc_after_conv(true), - _accumulate_biases(false) +GCFullyConnectedLayer::GCFullyConnectedLayer(std::shared_ptr memory_manager) + : _memory_group(std::move(memory_manager)), _im2col_kernel(), _reshape_weights_kernel(), _mm_kernel(), _accumulate_biases_kernel(), _im2col_output(), _reshape_weights_output(), + _are_weights_reshaped(true), _is_fc_after_conv(true), _accumulate_biases(false) { } @@ -61,6 +61,7 @@ void GCFullyConnectedLayer::configure_conv_fc(const IGCTensor *input, const IGCT _im2col_output.allocator()->init(TensorInfo(shape_im2col, 1, dt)); // Configure im2col kernel + _memory_group.manage(&_im2col_output); _im2col_kernel.configure(input, &_im2col_output, Size2D(1, 1), PadStrideInfo(1, 1, 0, 0), false); // Configure matrix multiply kernel @@ -156,6 +157,7 @@ void GCFullyConnectedLayer::run() _reshape_weights_kernel.run(); } + _memory_group.acquire(); // Linearize input if it comes from a convolutional layer if(_is_fc_after_conv) { @@ -177,4 +179,5 @@ void GCFullyConnectedLayer::run() GCScheduler::get().dispatch(_accumulate_biases_kernel); } + _memory_group.release(); } -- cgit v1.2.1