From d60a6b9d7977c6bd63ff7c523bed84d42363898b Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 10 Aug 2017 10:43:40 +0100 Subject: 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 Tested-by: Kaizen Reviewed-by: Georgios Pinitas --- src/runtime/CL/functions/CLNormalizationLayer.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/runtime') 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); } -- cgit v1.2.1