aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2019-06-19 12:28:47 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2019-07-03 09:36:46 +0000
commit4646d2e026a0fa92085fcba2f4aec5ec148956aa (patch)
tree0847684b138f9b4631cf56e20d0e75ef313607d0 /src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp
parentcbe39055f61bc7a3f6aef4588de47d48b77cf354 (diff)
downloadComputeLibrary-4646d2e026a0fa92085fcba2f4aec5ec148956aa.tar.gz
COMPMID-2072: Use a constexpr for num_elems_processed_per_iteration where possible
Change-Id: I26cb699ae3a77003ef7d05ac30d3ed518214e25f Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/1375 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Manuel Bottini <manuel.bottini@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLL2NormalizeLayerKernel.cpp18
1 files changed, 8 insertions, 10 deletions
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<Status, Window> 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<Status, Window> 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<std::string> 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