From 8a94e7cec7b09a417a278425e2b56e7af5bf45d9 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 15 Sep 2017 19:06:47 +0100 Subject: 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 Reviewed-by: Pablo Tello --- src/runtime/CL/functions/CLConvolution.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/runtime/CL/functions/CLConvolution.cpp') diff --git a/src/runtime/CL/functions/CLConvolution.cpp b/src/runtime/CL/functions/CLConvolution.cpp index 641044451d..a9b086773c 100644 --- a/src/runtime/CL/functions/CLConvolution.cpp +++ b/src/runtime/CL/functions/CLConvolution.cpp @@ -47,8 +47,8 @@ void CLConvolution3x3::configure(ICLTensor *input, ICLTensor *output, const int1 } template -CLConvolutionSquare::CLConvolutionSquare() - : _tmp(), _is_separable(false), _kernel_hor(), _kernel_vert(), _kernel(), _border_handler() +CLConvolutionSquare::CLConvolutionSquare(std::shared_ptr memory_manager) + : _memory_group(std::move(memory_manager)), _tmp(), _is_separable(false), _kernel_hor(), _kernel_vert(), _kernel(), _border_handler() { } @@ -66,6 +66,9 @@ void CLConvolutionSquare::configure(ICLTensor *input, ICLTensor *ou std::pair type_pair = data_type_for_convolution(conv_col, conv_row, matrix_size); _tmp.allocator()->init(TensorInfo(input->info()->tensor_shape(), 1, type_pair.first)); + // Manage intermediate buffers + _memory_group.manage(&_tmp); + if(scale == 0) { scale = calculate_matrix_scale(conv, matrix_size); @@ -92,8 +95,12 @@ void CLConvolutionSquare::run() if(_is_separable) { + _memory_group.acquire(); + CLScheduler::get().enqueue(_kernel_hor, false); CLScheduler::get().enqueue(_kernel_vert); + + _memory_group.release(); } else { -- cgit v1.2.1