aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLNormalizationLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/CL/functions/CLNormalizationLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLNormalizationLayer.cpp21
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);
}