T-SIMD v31.1.0
A C++ template SIMD library
Loading...
Searching...
No Matches
simd::HAcc< HOp, T, SIMD_WIDTH > Struct Template Reference

Iterative horizontal accumulator. Calculates the horizontal accumulation of multiple (Vec<T, SIMD_WIDTH>::elems) Vec's into a single Vec in parallel with the Vec's to be accumulated pushed one by one. More...

Detailed Description

template<class HOp, typename T, size_t SIMD_WIDTH>
struct simd::HAcc< HOp, T, SIMD_WIDTH >

Iterative horizontal accumulator. Calculates the horizontal accumulation of multiple (Vec<T, SIMD_WIDTH>::elems) Vec's into a single Vec in parallel with the Vec's to be accumulated pushed one by one.

Template Parameters
HOphorizontal accumulation operation, one of HAdd, HAdds, HMin, HMax

Public Member Functions

void finish ()
 Finishes the horizontal accumulation by pushing neutral values until the horizontal accumulation is done.
 
Vec< T, SIMD_WIDTH > get ()
 Gets the result of the horizontal accumulation. Finishes the horizontal accumulation if it is not done yet.
 
bool isDone () const
 Checks if the horizontal accumulation is done.
 
bool isEmpty () const
 Checks if the horizontal accumulation is empty, i.e. if no Vec has been pushed yet.
 
void push (const Vec< T, SIMD_WIDTH > &v)
 Pushes the next Vec to be horizontally accumulated. Does nothing if the horizontal accumulation is already done.
 
void reset ()
 Resets the horizontal accumulation.
 

Member Function Documentation

◆ get()

template<class HOp , typename T , size_t SIMD_WIDTH>
Vec< T, SIMD_WIDTH > simd::HAcc< HOp, T, SIMD_WIDTH >::get ( )
inline

Gets the result of the horizontal accumulation. Finishes the horizontal accumulation if it is not done yet.

Returns
result of the horizontal accumulation

◆ isDone()

template<class HOp , typename T , size_t SIMD_WIDTH>
bool simd::HAcc< HOp, T, SIMD_WIDTH >::isDone ( ) const
inline

Checks if the horizontal accumulation is done.

Returns
whether the horizontal accumulation is done

◆ isEmpty()

template<class HOp , typename T , size_t SIMD_WIDTH>
bool simd::HAcc< HOp, T, SIMD_WIDTH >::isEmpty ( ) const
inline

Checks if the horizontal accumulation is empty, i.e. if no Vec has been pushed yet.

Returns
whether the horizontal accumulation is empty

◆ push()

template<class HOp , typename T , size_t SIMD_WIDTH>
void simd::HAcc< HOp, T, SIMD_WIDTH >::push ( const Vec< T, SIMD_WIDTH > & v)
inline

Pushes the next Vec to be horizontally accumulated. Does nothing if the horizontal accumulation is already done.

Parameters
vVec to be pushed