YAKL
Classes | Functions
yakl::simd Namespace Reference

Holds YAKL's Pack class and operators to encourage SIMD vectorization. More...

Classes

class  Pack
 The Pack class performs encourages vectorization by performing operations Packs of known size. More...
 
struct  PackIterConfig
 Informs iterate_over_pack of the Pack size and whether to apply a SIMD pragma. More...
 

Functions

template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > abs (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > acos (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > asin (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > atan (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > ceil (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > cos (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > exp (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > floor (Pack< T, N > a)
 
template<class F , unsigned int N, bool SIMD = false>
YAKL_INLINE void iterate_over_pack (F const &f, PackIterConfig< N, SIMD > config)
 Perform a loop over the number of elements specified by the PackIterConfig object. More...
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > log (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > log10 (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > operator* (Pack< T, N > a, Pack< T, N > b)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator* (Pack< T, N > lhs, TLOC val)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator* (TLOC val, Pack< T, N > rhs)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > operator+ (Pack< T, N > a, Pack< T, N > b)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator+ (Pack< T, N > lhs, TLOC val)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator+ (TLOC val, Pack< T, N > rhs)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > operator- (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > operator- (Pack< T, N > a, Pack< T, N > b)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator- (Pack< T, N > lhs, TLOC val)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator- (TLOC val, Pack< T, N > rhs)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > operator/ (Pack< T, N > a, Pack< T, N > b)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator/ (Pack< T, N > lhs, TLOC val)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > operator/ (TLOC val, Pack< T, N > rhs)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > pow (Pack< T, N > a, Pack< T, N > b)
 
template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack< T, N > pow (Pack< T, N > lhs, TLOC val)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > round (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > sin (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > sqrt (Pack< T, N > a)
 
template<class T , unsigned int N>
YAKL_INLINE Pack< T, N > tan (Pack< T, N > a)
 

Detailed Description

Holds YAKL's Pack class and operators to encourage SIMD vectorization.

Function Documentation

◆ abs()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::abs ( Pack< T, N >  a)

◆ acos()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::acos ( Pack< T, N >  a)

◆ asin()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::asin ( Pack< T, N >  a)

◆ atan()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::atan ( Pack< T, N >  a)

◆ ceil()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::ceil ( Pack< T, N >  a)

◆ cos()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::cos ( Pack< T, N >  a)

◆ exp()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::exp ( Pack< T, N >  a)

◆ floor()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::floor ( Pack< T, N >  a)

◆ iterate_over_pack()

template<class F , unsigned int N, bool SIMD = false>
YAKL_INLINE void yakl::simd::iterate_over_pack ( F const &  f,
PackIterConfig< N, SIMD >  config 
)

Perform a loop over the number of elements specified by the PackIterConfig object.

If the config parameter also specifies that the SIMD template parameter is true, then apply SIMD pragmas. IMPORTANT: For the functor passed to this routine, please use [&] syntax, not YAKL_LAMBDA

Parameters
fThe functor object to execute inside the loop.
configyakl::PackIterConfig object with two template parameters: (1) the vector length (number of elements to loop over; and (2) a bool SIMD parameter to tell this routine whether or not it should apply a SIMD pragma.

◆ log()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::log ( Pack< T, N >  a)

◆ log10()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::log10 ( Pack< T, N >  a)

◆ operator*() [1/3]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::operator* ( Pack< T, N >  a,
Pack< T, N >  b 
)

◆ operator*() [2/3]

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

◆ operator*() [3/3]

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

◆ operator+() [1/3]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::operator+ ( Pack< T, N >  a,
Pack< T, N >  b 
)

◆ operator+() [2/3]

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

◆ operator+() [3/3]

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

◆ operator-() [1/4]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::operator- ( Pack< T, N >  a)

◆ operator-() [2/4]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::operator- ( Pack< T, N >  a,
Pack< T, N >  b 
)

◆ operator-() [3/4]

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

◆ operator-() [4/4]

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

◆ operator/() [1/3]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::operator/ ( Pack< T, N >  a,
Pack< T, N >  b 
)

◆ operator/() [2/3]

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

◆ operator/() [3/3]

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

◆ pow() [1/2]

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::pow ( Pack< T, N >  a,
Pack< T, N >  b 
)

◆ pow() [2/2]

template<class T , unsigned int N, class TLOC , typename std::enable_if< std::is_arithmetic< TLOC >::value, bool >::type = false>
YAKL_INLINE Pack<T,N> yakl::simd::pow ( Pack< T, N >  lhs,
TLOC  val 
)

◆ round()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::round ( Pack< T, N >  a)

◆ sin()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::sin ( Pack< T, N >  a)

◆ sqrt()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::sqrt ( Pack< T, N >  a)

◆ tan()

template<class T , unsigned int N>
YAKL_INLINE Pack<T,N> yakl::simd::tan ( Pack< T, N >  a)