diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-06-19 12:28:47 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2019-07-03 09:36:46 +0000 |
commit | 4646d2e026a0fa92085fcba2f4aec5ec148956aa (patch) | |
tree | 0847684b138f9b4631cf56e20d0e75ef313607d0 /src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp | |
parent | cbe39055f61bc7a3f6aef4588de47d48b77cf354 (diff) | |
download | ComputeLibrary-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/CLGEMMMatrixVectorMultiplyKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp b/src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp index 0ff2f1343a..9e5d677e89 100644 --- a/src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp +++ b/src/core/CL/kernels/CLGEMMMatrixVectorMultiplyKernel.cpp @@ -33,10 +33,13 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/core/Types.h" -using namespace arm_compute; - +namespace arm_compute +{ namespace { +constexpr unsigned int num_elems_read_per_iteration = 4; +constexpr unsigned int num_rows_read_per_iteration = 4; + Status validate_arguments(const ITensorInfo *input0, const ITensorInfo *input1, const ITensorInfo *output) { ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED(input0); @@ -50,9 +53,6 @@ Status validate_arguments(const ITensorInfo *input0, const ITensorInfo *input1, std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input0, ITensorInfo *input1, ITensorInfo *output) { - constexpr unsigned int num_elems_read_per_iteration = 4; - constexpr unsigned int num_rows_read_per_iteration = 4; - const unsigned int border_x = ceil_to_multiple(input0->dimension(0), num_elems_read_per_iteration) - input0->dimension(0); const unsigned int border_y = ceil_to_multiple(input0->dimension(1), num_rows_read_per_iteration) - input0->dimension(1); @@ -113,9 +113,7 @@ void CLGEMMMatrixVectorMultiplyKernel::configure(const ICLTensor *input0, const } // Configure kernel window - const unsigned int num_elems_read_per_iteration = 4; - - _num_rows_read_per_iteration = 4; + _num_rows_read_per_iteration = num_rows_read_per_iteration; const unsigned int border_x = ceil_to_multiple(input0->info()->dimension(0), num_elems_read_per_iteration) - input0->info()->dimension(0); const unsigned int border_y = ceil_to_multiple(input0->info()->dimension(1), _num_rows_read_per_iteration) - input0->info()->dimension(1); @@ -172,3 +170,4 @@ void CLGEMMMatrixVectorMultiplyKernel::run(const Window &window, cl::CommandQueu } while(window.slide_window_slice_3D(slice_in) && window.slide_window_slice_3D(slice_out)); } +} // namespace arm_compute |