YAKL
Public Member Functions | Static Public Member Functions | Friends | List of all members
yakl::simd::Pack< T, N > Class Template Reference

The Pack class performs encourages vectorization by performing operations Packs of known size. More...

#include <YAKL_simd.h>

Public Member Functions

YAKL_INLINE T & operator() (uint i)
 Returns a modifiable reference to the data at the requested index. More...
 
YAKL_INLINEoperator() (uint i) const
 Returns a non-modifiable value to the data at the requested index. More...
 
template<class TLOC >
YAKL_INLINE Pack< T, N > & operator*= (Pack< TLOC, N > rhs)
 
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > & operator*= (TLOC rhs)
 
template<class TLOC >
YAKL_INLINE Pack< T, N > & operator+= (Pack< TLOC, N > rhs)
 
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > & operator+= (TLOC rhs)
 
template<class TLOC >
YAKL_INLINE Pack< T, N > & operator-= (Pack< TLOC, N > rhs)
 
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > & operator-= (TLOC rhs)
 
template<class TLOC >
YAKL_INLINE Pack< T, N > & operator/= (Pack< TLOC, N > rhs)
 
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > & operator/= (TLOC rhs)
 
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > & operator= (TLOC rhs)
 

Static Public Member Functions

static YAKL_INLINE constexpr int get_pack_size ()
 Returns the number of elements in the Pack object. More...
 

Friends

std::ostream & operator<< (std::ostream &os, Pack< T, N > const &v)
 Print out the Pack object values to stdout. More...
 

Detailed Description

template<class T, unsigned int N>
class yakl::simd::Pack< T, N >

The Pack class performs encourages vectorization by performing operations Packs of known size.

Parameters
TData type of the Pack
NNumber of elements in the Pack object

Packs can be used by the user in order to encourage compilers to SIMD vectorize in cases where the compiler is having trouble determining when vector instructions can be generated.

For straighforward mathematical operations, simply apply that operation to the Pack object(s).

Whenever different behavior is needed for different members of the Pack object (e.g., if-statement), the user must iterate explicitly over the pack with yakl::iterate_over_pack.

Member Function Documentation

◆ get_pack_size()

template<class T , unsigned int N>
static YAKL_INLINE constexpr int yakl::simd::Pack< T, N >::get_pack_size ( )
inlinestaticconstexpr

Returns the number of elements in the Pack object.

◆ operator()() [1/2]

template<class T , unsigned int N>
YAKL_INLINE T& yakl::simd::Pack< T, N >::operator() ( uint  i)
inline

Returns a modifiable reference to the data at the requested index.

◆ operator()() [2/2]

template<class T , unsigned int N>
YAKL_INLINE T yakl::simd::Pack< T, N >::operator() ( uint  i) const
inline

Returns a non-modifiable value to the data at the requested index.

◆ operator*=() [1/2]

template<class T , unsigned int N>
template<class TLOC >
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator*= ( Pack< TLOC, N >  rhs)
inline

◆ operator*=() [2/2]

template<class T , unsigned int N>
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator*= ( TLOC  rhs)
inline

◆ operator+=() [1/2]

template<class T , unsigned int N>
template<class TLOC >
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator+= ( Pack< TLOC, N >  rhs)
inline

◆ operator+=() [2/2]

template<class T , unsigned int N>
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator+= ( TLOC  rhs)
inline

◆ operator-=() [1/2]

template<class T , unsigned int N>
template<class TLOC >
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator-= ( Pack< TLOC, N >  rhs)
inline

◆ operator-=() [2/2]

template<class T , unsigned int N>
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator-= ( TLOC  rhs)
inline

◆ operator/=() [1/2]

template<class T , unsigned int N>
template<class TLOC >
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator/= ( Pack< TLOC, N >  rhs)
inline

◆ operator/=() [2/2]

template<class T , unsigned int N>
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator/= ( TLOC  rhs)
inline

◆ operator=()

template<class T , unsigned int N>
template<class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N>& yakl::simd::Pack< T, N >::operator= ( TLOC  rhs)
inline

Friends And Related Function Documentation

◆ operator<<

template<class T , unsigned int N>
std::ostream& operator<< ( std::ostream &  os,
Pack< T, N > const &  v 
)
friend

Print out the Pack object values to stdout.


The documentation for this class was generated from the following file: