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/CLAccumulateKernel.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/core/CL/kernels/CLAccumulateKernel.cpp') diff --git a/src/core/CL/kernels/CLAccumulateKernel.cpp b/src/core/CL/kernels/CLAccumulateKernel.cpp index 6333f04e71..12ee210243 100644 --- a/src/core/CL/kernels/CLAccumulateKernel.cpp +++ b/src/core/CL/kernels/CLAccumulateKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -31,7 +31,12 @@ #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" -using namespace arm_compute; +namespace arm_compute +{ +namespace +{ +constexpr unsigned int num_elems_processed_per_iteration = 16; +} // namespace void CLAccumulateKernel::configure(const ICLTensor *input, ICLTensor *accum) { @@ -42,7 +47,6 @@ void CLAccumulateKernel::configure(const ICLTensor *input, ICLTensor *accum) _kernel = static_cast(CLKernelLibrary::get().create_kernel("accumulate")); // Make sure _kernel is initialized before calling the parent's configure - constexpr unsigned int num_elems_processed_per_iteration = 16; ICLSimple2DKernel::configure(input, accum, num_elems_processed_per_iteration); } @@ -60,7 +64,6 @@ void CLAccumulateWeightedKernel::configure(const ICLTensor *input, float alpha, _kernel.setArg(idx++, alpha); // Configure kernel window - constexpr unsigned int num_elems_processed_per_iteration = 16; ICLSimple2DKernel::configure(input, accum, num_elems_processed_per_iteration); } @@ -78,6 +81,6 @@ void CLAccumulateSquaredKernel::configure(const ICLTensor *input, uint32_t shift _kernel.setArg(idx++, shift); // Configure kernel window - constexpr unsigned int num_elems_processed_per_iteration = 16; ICLSimple2DKernel::configure(input, accum, num_elems_processed_per_iteration); } +} // namespace arm_compute -- cgit v1.2.1