RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Public Member Functions | List of all members
RAJA::KahanSum< T, sum_impl > Struct Template Reference

Reduce class that does a reduction with a left fold. More...

#include <reduce.hpp>

Public Member Functions

RAJA_HOST_DEVICE constexpr RAJA_INLINE KahanSum (T init=T()) noexcept
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE void reset (T init=T()) noexcept
 reset the combined value of the reducer to the identity More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE T get_and_reset (T init=T())
 return the combined value and reset the reducer More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE T get () const
 return the combined value More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE void combine (T val)
 combine a value into the reducer More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE void operator+= (T val)
 combine a value into the reducer More...
 

Detailed Description

template<typename T, KahanSumImplementation sum_impl = KahanSumImplementation::Default>
struct RAJA::KahanSum< T, sum_impl >

Reduce class that does a reduction with a left fold.

Note
KahanSum does not take an binary operation as the only valid operation is plus.
sum_impl can be used to have the implementation use volatile on some intermediate values to force compilers to not optimize out the compensated summation if fast-math is enabled.

Constructor & Destructor Documentation

◆ KahanSum()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE RAJA::KahanSum< T, sum_impl >::KahanSum ( init = T())
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ reset()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::KahanSum< T, sum_impl >::reset ( init = T())
inlineconstexprnoexcept

reset the combined value of the reducer to the identity

◆ get_and_reset()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE T RAJA::KahanSum< T, sum_impl >::get_and_reset ( init = T())
inlineconstexpr

return the combined value and reset the reducer

◆ get()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE T RAJA::KahanSum< T, sum_impl >::get ( ) const
inlineconstexpr

return the combined value

◆ combine()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::KahanSum< T, sum_impl >::combine ( val)
inlineconstexpr

combine a value into the reducer

◆ operator+=()

template<typename T , KahanSumImplementation sum_impl = KahanSumImplementation::Default>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::KahanSum< T, sum_impl >::operator+= ( val)
inlineconstexpr

combine a value into the reducer


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