Reduction operators¶
|
generic batch reduction |
|
sum of each batch element |
|
max of the batch elements |
|
min of the batch elements |
|
horizontal sum across batches |
- template <class T, class A>
-
batch<T, A>
xsimd::haddp(batch<T, A> const *row)¶ Parallel horizontal addition: adds the scalars of each batch in the array pointed by
rowand store them in a returned batch.- Return
the result of the reduction.
- Parameters
row: an array ofNbatches
- template <class T, class A, class F>
-
T
xsimd::reduce(F &&f, batch<T, A> const &x)¶ Generic reducer using only batch operations.
- Return
the result of the reduction, as a scalar.
- Parameters
f: reducing function, acceptingbatch ()(batch, batch)x: batch involved in the reduction
- template <class T, class A>
-
T
xsimd::reduce_add(batch<T, A> const &x)¶ Adds all the scalars of the batch
x.- Return
the result of the reduction.
- Parameters
x: batch involved in the reduction
- template <class T, class A>
-
T
xsimd::reduce_max(batch<T, A> const &x)¶ Max of all the scalars of the batch
x.- Return
the result of the reduction.
- Parameters
x: batch involved in the reduction
- template <class T, class A>
-
T
xsimd::reduce_min(batch<T, A> const &x)¶ Min of all the scalars of the batch
x.- Return
the result of the reduction.
- Parameters
x: batch involved in the reduction