From d8734b55d89f05901ba9a75349761a9c955d9243 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 22 Dec 2017 15:27:52 +0000 Subject: COMPMID-793 : Add graph intermediate representation Change-Id: Ic1685de4e19e0ac79669ef2da64e1dc96c7ea0bf Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115248 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- src/runtime/CL/CLSubTensor.cpp | 5 +++++ src/runtime/CL/functions/CLGEMM.cpp | 6 ++++-- src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp | 10 +++------- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 1 + src/runtime/SubTensor.cpp | 5 +++++ 5 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/CL/CLSubTensor.cpp b/src/runtime/CL/CLSubTensor.cpp index 5f58024b0e..d0e7d760ff 100644 --- a/src/runtime/CL/CLSubTensor.cpp +++ b/src/runtime/CL/CLSubTensor.cpp @@ -29,6 +29,11 @@ using namespace arm_compute; +CLSubTensor::CLSubTensor() + : _parent(nullptr), _info() +{ +} + CLSubTensor::CLSubTensor(ICLTensor *parent, const TensorShape &tensor_shape, const Coordinates &coords, bool extend_parent) : _parent(nullptr), _info() { diff --git a/src/runtime/CL/functions/CLGEMM.cpp b/src/runtime/CL/functions/CLGEMM.cpp index e6f8f266d8..c1926a78d1 100644 --- a/src/runtime/CL/functions/CLGEMM.cpp +++ b/src/runtime/CL/functions/CLGEMM.cpp @@ -138,8 +138,10 @@ void CLGEMM::configure(const ICLTensor *a, const ICLTensor *b, const ICLTensor * // Manage intermediate buffers _memory_group.manage(&_tmp_a); - _memory_group.manage(&_tmp_b); - + if(_reshape_b_only_on_first_run) + { + _memory_group.manage(&_tmp_b); + } // _tmp_a and _tmp_b will be auto configured in _interleave_kernel and in _transpose_kernel // Configure interleave kernel diff --git a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp index 3cba98ce0e..bc339f176f 100644 --- a/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLGEMMConvolutionLayer.cpp @@ -38,8 +38,8 @@ using namespace arm_compute; using namespace arm_compute::misc::shape_calculator; -CLConvolutionLayerReshapeWeights::CLConvolutionLayerReshapeWeights(std::shared_ptr memory_manager) - : _memory_group(std::move(memory_manager)), _weights_reshape_kernel(), _weights_transposed_kernel(), _weights_reshaped() +CLConvolutionLayerReshapeWeights::CLConvolutionLayerReshapeWeights() + : _weights_reshape_kernel() { } @@ -86,16 +86,12 @@ Status CLConvolutionLayerReshapeWeights::validate(const ITensorInfo *weights, co void CLConvolutionLayerReshapeWeights::run() { - _memory_group.acquire(); - CLScheduler::get().enqueue(_weights_reshape_kernel); - - _memory_group.release(); } 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), _is_first_run(true) + _weights_reshaped(), _gemm_output(), _tmp_output(), _is_quantized(false), _is_first_run(true) { } diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 0a491589ff..c16ce9b960 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -30,6 +30,7 @@ #include #include +#include namespace arm_compute { diff --git a/src/runtime/SubTensor.cpp b/src/runtime/SubTensor.cpp index c5b8f33c9a..b010a32eca 100644 --- a/src/runtime/SubTensor.cpp +++ b/src/runtime/SubTensor.cpp @@ -27,6 +27,11 @@ using namespace arm_compute; +SubTensor::SubTensor() + : _parent(nullptr), _info() +{ +} + SubTensor::SubTensor(ITensor *parent, const TensorShape &tensor_shape, const Coordinates &coords, bool extend_parent) : _parent(nullptr), _info() { -- cgit v1.2.1