diff options
author | Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-27 17:46:17 +0100 |
---|---|---|
committer | felixjohnny.thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> | 2023-09-28 12:08:05 +0000 |
commit | afd38f0c617d6f89b2b4532c6c44f116617e2b6f (patch) | |
tree | 03bc7d5a762099989b16a656fa8d397b490ed70e /src/cpu/kernels/range/generic | |
parent | bdcb4c148ee2fdeaaddf4cf1e57bbb0de02bb894 (diff) | |
download | ComputeLibrary-afd38f0c617d6f89b2b4532c6c44f116617e2b6f.tar.gz |
Apply clang-format on repository
Code is formatted as per a revised clang format configuration
file(not part of this delivery). Version 14.0.6 is used.
Exclusion List:
- files with .cl extension
- files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...)
And the following directories
- compute_kernel_writer/validation/
- tests/
- include/
- src/core/NEON/kernels/convolution/
- src/core/NEON/kernels/arm_gemm/
- src/core/NEON/kernels/arm_conv/
- data/
There will be a follow up for formatting of .cl files and the
files under tests/ and compute_kernel_writer/validation/.
Signed-off-by: Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com>
Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Diffstat (limited to 'src/cpu/kernels/range/generic')
-rw-r--r-- | src/cpu/kernels/range/generic/neon/fp16.cpp | 4 | ||||
-rw-r--r-- | src/cpu/kernels/range/generic/neon/fp32.cpp | 4 | ||||
-rw-r--r-- | src/cpu/kernels/range/generic/neon/impl.h | 48 |
3 files changed, 29 insertions, 27 deletions
diff --git a/src/cpu/kernels/range/generic/neon/fp16.cpp b/src/cpu/kernels/range/generic/neon/fp16.cpp index 5d50dce907..505c18c27d 100644 --- a/src/cpu/kernels/range/generic/neon/fp16.cpp +++ b/src/cpu/kernels/range/generic/neon/fp16.cpp @@ -23,10 +23,10 @@ */ #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) -#include "src/cpu/kernels/range/generic/neon/impl.h" - #include "arm_compute/core/Helpers.h" + #include "src/core/NEON/wrapper/wrapper.h" +#include "src/cpu/kernels/range/generic/neon/impl.h" namespace arm_compute { diff --git a/src/cpu/kernels/range/generic/neon/fp32.cpp b/src/cpu/kernels/range/generic/neon/fp32.cpp index 6044f0f886..e5e472abb5 100644 --- a/src/cpu/kernels/range/generic/neon/fp32.cpp +++ b/src/cpu/kernels/range/generic/neon/fp32.cpp @@ -22,10 +22,10 @@ * SOFTWARE. */ -#include "src/cpu/kernels/range/generic/neon/impl.h" - #include "arm_compute/core/Helpers.h" + #include "src/core/NEON/wrapper/wrapper.h" +#include "src/cpu/kernels/range/generic/neon/impl.h" namespace arm_compute { diff --git a/src/cpu/kernels/range/generic/neon/impl.h b/src/cpu/kernels/range/generic/neon/impl.h index 62144e6776..f8c30d52a0 100644 --- a/src/cpu/kernels/range/generic/neon/impl.h +++ b/src/cpu/kernels/range/generic/neon/impl.h @@ -26,8 +26,9 @@ #include "arm_compute/core/Helpers.h" #include "arm_compute/core/TensorInfo.h" -#include "src/core/NEON/wrapper/wrapper.h" + #include "src/core/common/Registrars.h" +#include "src/core/NEON/wrapper/wrapper.h" namespace arm_compute { @@ -47,35 +48,36 @@ void neon_range_function(ITensor *output, float start, float step, const Window const auto window_end_x = static_cast<int>(window.x().end()); const int window_step_x = 16 / sizeof(T); - Window win{ window }; + Window win{window}; win.set(Window::DimX, Window::Dimension(0, 1, 1)); Iterator output_it(output, win); - execute_window_loop(win, [&](const Coordinates &) - { - int x = window_start_x; - const auto out_ptr = reinterpret_cast<T *>(output_it.ptr()); - for(; x <= (window_end_x - window_step_x); x += window_step_x) + execute_window_loop( + win, + [&](const Coordinates &) { - for(int count = 0; count < window_step_x; ++count) + int x = window_start_x; + const auto out_ptr = reinterpret_cast<T *>(output_it.ptr()); + for (; x <= (window_end_x - window_step_x); x += window_step_x) { - id_vec = wrapper::vsetlane(static_cast<T>(x + count), id_vec, count); - } - - // start + step * id - const auto res_vec = wrapper::vmla(start_vec, id_vec, step_vec); - wrapper::vstore(out_ptr + x, res_vec); - } + for (int count = 0; count < window_step_x; ++count) + { + id_vec = wrapper::vsetlane(static_cast<T>(x + count), id_vec, count); + } - // Compute left-over elements - for(; x < window_end_x; ++x) - { - const auto res = start + x * step; - *(out_ptr + x) = res; - } + // start + step * id + const auto res_vec = wrapper::vmla(start_vec, id_vec, step_vec); + wrapper::vstore(out_ptr + x, res_vec); + } - }, - output_it); + // Compute left-over elements + for (; x < window_end_x; ++x) + { + const auto res = start + x * step; + *(out_ptr + x) = res; + } + }, + output_it); } } // namespace cpu } // namespace arm_compute |