RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Classes | Public Member Functions | Static Public Attributes | List of all members
RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels > Struct Template Reference

Reduce class that does a reduction with a binary tree. More...

#include <reduce.hpp>

Public Member Functions

RAJA_HOST_DEVICE constexpr RAJA_INLINE BinaryTreeReduce (T init=BinaryOp::identity(), BinaryOp op=BinaryOp {}) noexcept
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE void reset (T init=BinaryOp::identity()) noexcept
 reset the combined value of the reducer to the identity More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE T get_and_reset (T init=BinaryOp::identity())
 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 value)
 combine a value into the reducer More...
 
RAJA_HOST_DEVICE constexpr RAJA_INLINE void operator+= (T value)
 combine a value into the reducer More...
 

Static Public Attributes

static constexpr SizeType num_levels = t_num_levels
 

Detailed Description

template<typename T, typename BinaryOp, typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
struct RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >

Reduce class that does a reduction with a binary tree.

Constructor & Destructor Documentation

◆ BinaryTreeReduce()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::BinaryTreeReduce ( init = BinaryOp::identity(),
BinaryOp  op = BinaryOp {} 
)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ reset()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::reset ( init = BinaryOp::identity())
inlineconstexprnoexcept

reset the combined value of the reducer to the identity

◆ get_and_reset()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE T RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::get_and_reset ( init = BinaryOp::identity())
inlineconstexpr

return the combined value and reset the reducer

◆ get()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE T RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::get ( ) const
inlineconstexpr

return the combined value

◆ combine()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::combine ( value)
inlineconstexpr

combine a value into the reducer

◆ operator+=()

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
RAJA_HOST_DEVICE constexpr RAJA_INLINE void RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::operator+= ( value)
inlineconstexpr

combine a value into the reducer

Member Data Documentation

◆ num_levels

template<typename T , typename BinaryOp , typename SizeType = size_t, SizeType t_num_levels = CHAR_BIT * sizeof(SizeType)>
constexpr SizeType RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >::num_levels = t_num_levels
staticconstexpr

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