Skip to content

function horizontal(const vec<T, N> &, ReduceFn &&) horizontal

template <typename T, size_t N, typename ReduceFn>
KFR_INTRINSIC T horizontal(const vec<T, N>& value, ReduceFn&& reduce)

Applies a reduction function horizontally across all elements of the vector.

Template parameters
T The element type of the vector.
N The number of elements in the vector.
ReduceFn The reduction function type.
Parameters
value The input vector.
reduce The reduction function to apply.
Returns
The result of the reduction across all elements.

Defined at simd/horizontal.hpp:71