From 3502613ec7223a415c6f648d8e0b54d387e00d7d Mon Sep 17 00:00:00 2001 From: Gian Marco Date: Thu, 22 Feb 2018 15:28:44 +0000 Subject: COMPMID-765 - Fix performance issues on OpenCL The problem was related to the reshape of the weights. The reshaping happened for each run Change-Id: Ie7d02fa6bb08df34e44213303e9eb0700ff77160 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121877 Reviewed-by: Michele DiGiorgio Reviewed-by: Pablo Tello Reviewed-by: Anthony Barbier Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp index 23c3050476..3cba98ce0e 100644 --- a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp @@ -95,7 +95,7 @@ void CLConvolutionLayerReshapeWeights::run() CLGEMMConvolutionLayer::CLGEMMConvolutionLayer(std::shared_ptr memory_manager) : _memory_group(memory_manager), _reshape_weights(), _im2col_kernel(), _mm_gemm(memory_manager), _mm_gemmlowp(memory_manager), _gemmlowp_output_stage(), _col2im_kernel(), _im2col_output(), - _interleave_output(), _weights_reshaped(), _weights_transposed(), _gemm_output(), _tmp_output(), _is_quantized(false) + _interleave_output(), _weights_reshaped(), _weights_transposed(), _gemm_output(), _tmp_output(), _is_quantized(false), _is_first_run(true) { } @@ -349,7 +349,12 @@ Status CLGEMMConvolutionLayer::validate(const ITensorInfo *input, const ITensorI void CLGEMMConvolutionLayer::run() { // Run weights reshaping (Runs once for every configure) - _reshape_weights.run(); + if(_is_first_run) + { + _reshape_weights.run(); + + _is_first_run = false; + } _memory_group.acquire(); -- cgit v1.2.1