diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2017-08-10 10:43:40 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | d60a6b9d7977c6bd63ff7c523bed84d42363898b (patch) | |
tree | 4b1ef99dfd76883060688dcaadbadaaf5c14cf6d /src/runtime | |
parent | 4e09b3839206254d0df56095ad0762718a764c9c (diff) | |
download | ComputeLibrary-d60a6b9d7977c6bd63ff7c523bed84d42363898b.tar.gz |
COMPMID-477 - Optimized CLNormalizationLayer
CLPixelWiseMultiplication has been removed within the function
Change-Id: Ibe7edd7921d5cef6ff68fdeeca89771129a8eaea
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/84459
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/CL/functions/CLNormalizationLayer.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/runtime/CL/functions/CLNormalizationLayer.cpp b/src/runtime/CL/functions/CLNormalizationLayer.cpp index 69cef334e8..f4bd49406c 100644 --- a/src/runtime/CL/functions/CLNormalizationLayer.cpp +++ b/src/runtime/CL/functions/CLNormalizationLayer.cpp @@ -33,29 +33,26 @@ using namespace arm_compute; CLNormalizationLayer::CLNormalizationLayer() - : _squared_input(), _norm_kernel(), _multiply_kernel(), _border_handler() + : _norm_kernel(), _border_handler() { } -void CLNormalizationLayer::configure(const ICLTensor *input, ICLTensor *output, NormalizationLayerInfo norm_info) +void CLNormalizationLayer::configure(ICLTensor *input, ICLTensor *output, NormalizationLayerInfo norm_info) { ARM_COMPUTE_ERROR_ON(input == nullptr); - TensorInfo tensor_info(input->info()->tensor_shape(), 1, input->info()->data_type(), input->info()->fixed_point_position()); - _squared_input.allocator()->init(tensor_info); + // Configure normalization kernel + _norm_kernel.configure(input, output, norm_info); - _norm_kernel.configure(input, &_squared_input, output, norm_info); - _multiply_kernel.configure(input, input, &_squared_input, 1.0f, ConvertPolicy::SATURATE, RoundingPolicy::TO_NEAREST_EVEN); // Fill the border by 3 elements since we need vload4 in the IN_MAP normalization kernel - _border_handler.configure(&_squared_input, _norm_kernel.border_size(), BorderMode::CONSTANT, PixelValue(0)); - - // Allocate intermediate buffers - _squared_input.allocator()->allocate(); + _border_handler.configure(input, _norm_kernel.border_size(), BorderMode::CONSTANT, PixelValue(0)); } void CLNormalizationLayer::run() { - CLScheduler::get().enqueue(_multiply_kernel, false); + // Run border handler CLScheduler::get().enqueue(_border_handler, false); - CLScheduler::get().enqueue(_norm_kernel, false); + + // Run normalization kernel + CLScheduler::get().enqueue(_norm_kernel); } |