diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-09-08 19:47:30 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | baf174e85ddb5399355281cd34d0f459d92124a7 (patch) | |
tree | d69904df66f7e5ad55edd268d16735542445f36f /arm_compute/runtime/CL/functions | |
parent | 1c8409d7ce90ea449437076574c98a4ea90d9368 (diff) | |
download | ComputeLibrary-baf174e85ddb5399355281cd34d0f459d92124a7.tar.gz |
COMPMID-485: Memory Manager
Change-Id: Ib421b7622838f050038cd81e7426bb1413a7d6e6
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87376
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/functions')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLConvolutionLayer.h | 10 | ||||
-rw-r--r-- | arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h | 4 | ||||
-rw-r--r-- | arm_compute/runtime/CL/functions/CLSoftmaxLayer.h | 7 |
3 files changed, 17 insertions, 4 deletions
diff --git a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h index 2057b6ff8a..cd1ea70a23 100644 --- a/arm_compute/runtime/CL/functions/CLConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLConvolutionLayer.h @@ -34,7 +34,11 @@ #include "arm_compute/core/CL/kernels/CLIm2ColKernel.h" #include "arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" +#include "arm_compute/runtime/IMemoryManager.h" + +#include <memory> namespace arm_compute { @@ -48,7 +52,7 @@ class CLConvolutionLayerReshapeWeights : public IFunction { public: /** Constructor */ - CLConvolutionLayerReshapeWeights(); + CLConvolutionLayerReshapeWeights(std::shared_ptr<IMemoryManager> memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: QS8/QS16/F16/F32. @@ -62,6 +66,7 @@ public: void run() override; private: + CLMemoryGroup _memory_group; CLWeightsReshapeKernel _weights_reshape_kernel; CLGEMMTranspose1xWKernel _weights_transposed_kernel; CLTensor _weights_reshaped; @@ -81,7 +86,7 @@ class CLConvolutionLayer : public IFunction { public: /** Default constructor */ - CLConvolutionLayer(); + CLConvolutionLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] input Source tensor. 3 lower dimensions represent a single input [width, height, IFM], @@ -101,6 +106,7 @@ public: void run() override; private: + CLMemoryGroup _memory_group; CLConvolutionLayerReshapeWeights _reshape_weights; CLIm2ColKernel _input_im2col_kernel; CLGEMMInterleave4x4Kernel _input_interleave_kernel; diff --git a/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h b/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h index e076f51b26..f71e2a33f9 100644 --- a/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h +++ b/arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h @@ -30,6 +30,7 @@ #include "arm_compute/core/CL/kernels/CLGEMMMatrixMultiplyKernel.h" #include "arm_compute/core/CL/kernels/CLIm2ColKernel.h" #include "arm_compute/core/CL/kernels/CLTransposeKernel.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" namespace arm_compute @@ -64,7 +65,7 @@ class CLFullyConnectedLayer : public IFunction { public: /** Constructor */ - CLFullyConnectedLayer(); + CLFullyConnectedLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] input Source tensor. Data type supported: QS8/QS16/F16/F32. @@ -83,6 +84,7 @@ private: void configure_fc_fc(const ICLTensor *input, const ICLTensor *weights, ICLTensor *output); void configure_conv_fc(const ICLTensor *input, const ICLTensor *weights, ICLTensor *output); + CLMemoryGroup _memory_group; CLIm2ColKernel _im2col_kernel; CLFullyConnectedLayerReshapeWeights _reshape_weights_kernel; CLGEMMMatrixMultiplyKernel _mm_kernel; diff --git a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h index 18f7a02a3e..70a265c1ae 100644 --- a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h +++ b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h @@ -25,8 +25,12 @@ #define __ARM_COMPUTE_CLSOFTMAXLAYER_H__ #include "arm_compute/core/CL/kernels/CLSoftmaxLayerKernel.h" +#include "arm_compute/runtime/CL/CLMemoryGroup.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/IFunction.h" +#include "arm_compute/runtime/IMemoryManager.h" + +#include <memory> namespace arm_compute { @@ -46,7 +50,7 @@ class CLSoftmaxLayer : public IFunction { public: /** Constructor */ - CLSoftmaxLayer(); + CLSoftmaxLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); /** Set the input and output tensors. * * @param[in] input Source tensor. Data types supported: QS8/QS16/F16/F32 @@ -58,6 +62,7 @@ public: void run() override; private: + CLMemoryGroup _memory_group; CLLogits1DMaxKernel _max_kernel; CLLogits1DShiftExpSumKernel _shift_exp_sum_kernel; CLLogits1DNormKernel _norm_kernel; |