24.02.1
|
Go to the documentation of this file.
36 const float32x4_t beta_f32 = vdupq_n_f32(beta);
38 constexpr
int window_step_x = 16;
39 const auto window_start_x =
static_cast<int>(window.
x().
start());
40 const auto window_end_x =
static_cast<int>(window.
x().
end());
52 const auto in_ptr =
reinterpret_cast<const float *
>(in.
ptr());
53 const auto out_ptr =
reinterpret_cast<float *
>(out.
ptr());
55 int x = window_start_x;
56 for (; x < (window_end_x - window_step_x); x += window_step_x)
58 float32x4x4_t alpha_ab = vld4q_f32(out_ptr + x);
59 const float32x4x4_t c = vld4q_f32(in_ptr + x);
62 alpha_ab.val[0] = vmlaq_f32(alpha_ab.val[0], c.val[0], beta_f32);
63 alpha_ab.val[1] = vmlaq_f32(alpha_ab.val[1], c.val[1], beta_f32);
64 alpha_ab.val[2] = vmlaq_f32(alpha_ab.val[2], c.val[2], beta_f32);
65 alpha_ab.val[3] = vmlaq_f32(alpha_ab.val[3], c.val[3], beta_f32);
67 vst4q_f32(out_ptr + x, alpha_ab);
71 for (; x < window_end_x; ++x)
73 *(out_ptr + x) += *(in_ptr + x) * beta;
constexpr int start() const
Return the start of the dimension.
SimpleTensor< float > src
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Interface for CPU tensor.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Iterator updated by execute_window_loop for each window element.
void matrix_addition_f32(const ITensor *src, ITensor *dst, const Window &window, float beta)
Describe one of the image's dimensions with a start, end and step.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
Describe a multidimensional execution window.
Copyright (c) 2017-2024 Arm Limited.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
constexpr int end() const
Return the end of the dimension.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.