From 4646d2e026a0fa92085fcba2f4aec5ec148956aa Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Wed, 19 Jun 2019 12:28:47 +0100 Subject: COMPMID-2072: Use a constexpr for num_elems_processed_per_iteration where possible Change-Id: I26cb699ae3a77003ef7d05ac30d3ed518214e25f Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/1375 Comments-Addressed: Arm Jenkins Reviewed-by: Manuel Bottini Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez --- src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp') diff --git a/src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp b/src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp index 288e1e8e61..8816138e2e 100644 --- a/src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp +++ b/src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp @@ -37,15 +37,12 @@ namespace arm_compute { -CLL2NormalizeLayerKernel::CLL2NormalizeLayerKernel() - : _input(nullptr), _sum(nullptr), _output(nullptr), _actual_axis(0), _epsilon(1e-12) -{ -} - namespace { constexpr int max_input_tensor_dim = 3; +constexpr unsigned int num_elems_processed_per_iteration = 16; + Status validate_arguments(const ITensorInfo *input, const ITensorInfo *sum, const ITensorInfo *output, int axis, float epsilon) { ARM_COMPUTE_UNUSED(epsilon); @@ -76,8 +73,6 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *sum, cons std::tuple validate_and_configure_window(ITensorInfo *input, ITensorInfo *output) { - const unsigned int num_elems_processed_per_iteration = 16; - Window win = calculate_max_window(*input, Steps(num_elems_processed_per_iteration)); // Output tensor auto initialization if not yet initialized @@ -95,6 +90,11 @@ std::tuple validate_and_configure_window(ITensorInfo *input, ITe } } // namespace +CLL2NormalizeLayerKernel::CLL2NormalizeLayerKernel() + : _input(nullptr), _sum(nullptr), _output(nullptr), _actual_axis(0), _epsilon(1e-12) +{ +} + void CLL2NormalizeLayerKernel::configure(const ICLTensor *input, const ICLTensor *sum, ICLTensor *output, int axis, float epsilon) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, sum, output); @@ -106,8 +106,6 @@ void CLL2NormalizeLayerKernel::configure(const ICLTensor *input, const ICLTensor _actual_axis = wrap_around(axis, max_input_tensor_dim); _epsilon = epsilon; - const unsigned int num_elems_processed_per_iteration = 16; - // Set build options std::set build_opts; build_opts.emplace(("-DDATA_TYPE=" + get_cl_type_from_data_type(input->info()->data_type()))); @@ -221,4 +219,4 @@ void CLL2NormalizeLayerKernel::run(const Window &window, cl::CommandQueue &queue ARM_COMPUTE_ERROR("Not supported"); } } -} // namespace arm_compute \ No newline at end of file +} // namespace arm_compute -- cgit v1.2.1