35 #ifndef _BLAZE_MATH_SIMD_REDUCE_H_ 36 #define _BLAZE_MATH_SIMD_REDUCE_H_ 67 template<
typename T,
typename OP >
70 using ValueType =
typename T::ValueType;
72 alignas( AlignmentOf_v<ValueType> ) ValueType array[
T::size];
75 ValueType redux( array[0UL] );
76 for(
size_t k=1UL; k<
T::size; ++k ) {
77 redux = op( redux, array[k] );
93 template<
typename T >
94 inline decltype(
auto)
reduce( const SIMDPack<T>& a, const Add& )
110 template<
typename T >
111 inline decltype(
auto)
reduce( const SIMDPack<T>& a, const Mult& )
Header file for the AlignmentOf type trait.
decltype(auto) prod(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of multiplication.
Definition: DMatReduceExpr.h:2220
Header file for the SIMDPack base class.
Header file for the SIMD aligned store functionality.
decltype(auto) reduce(const DenseMatrix< MT, SO > &dm, OP op)
Performs a custom reduction operation on the given dense matrix.
Definition: DMatReduceExpr.h:2017
Header file for the SIMD multiplication reduction functionality.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) sum(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of addition.
Definition: DMatReduceExpr.h:2147
Header file for the SIMD addition reduction functionality.
Header file for all functor forward declarations.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Base class for all SIMD data types.The SIMDPack class template is a base class for all SIMD data type...
Definition: SIMDPack.h:63
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530