RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Classes | Namespaces | Typedefs | Enumerations | Functions
reduce.hpp File Reference

Header file providing RAJA sort templates. More...

#include "RAJA/config.hpp"
#include <climits>
#include <iterator>
#include <new>
#include <type_traits>
#include "RAJA/pattern/detail/algorithm.hpp"
#include "RAJA/util/macros.hpp"
#include "RAJA/util/concepts.hpp"
#include "RAJA/util/math.hpp"
#include "RAJA/util/Operators.hpp"

Go to the source code of this file.

Classes

struct  RAJA::LeftFoldReduce< T, BinaryOp >
 Reduce class that does a reduction with a left fold. More...
 
struct  RAJA::BinaryTreeReduce< T, BinaryOp, SizeType, t_num_levels >
 Reduce class that does a reduction with a binary tree. More...
 
struct  RAJA::KahanSum< T, sum_impl >
 Reduce class that does a reduction with a left fold. More...
 

Namespaces

 RAJA
 

Typedefs

template<typename T , typename BinaryOp >
using RAJA::HighAccuracyReduce = std::conditional_t< RAJA::operators::is_fp_associative< T >::value, BinaryTreeReduce< T, BinaryOp >, LeftFoldReduce< T, BinaryOp > >
 

Enumerations

enum class  RAJA::KahanSumImplementation { RAJA::Default , RAJA::Volatile }
 

Functions

template<typename Container , typename T = detail::ContainerVal<Container>, typename BinaryOp = operators::plus<T>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container > > RAJA::left_fold_reduce (Container &&c, T init=BinaryOp::identity(), BinaryOp op=BinaryOp {})
 Accumulate given range to a single value using a left fold algorithm in O(N) operations and O(1) extra memory see https://en.cppreference.com/w/cpp/algorithm/accumulate. More...
 
template<typename Container , typename T = detail::ContainerVal<Container>, typename BinaryOp = operators::plus<T>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container > > RAJA::binary_tree_reduce (Container &&c, T init=BinaryOp::identity(), BinaryOp op=BinaryOp {})
 Reduce given range to a single value using a binary tree algorithm in O(N) operations and O(lg(N)) extra memory see https://en.cppreference.com/w/cpp/algorithm/reduce. More...
 
template<typename Container , typename T = detail::ContainerVal<Container>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container >, std::is_floating_point< T > > RAJA::kahan_sum (Container &&c, T init=T())
 Accumulate given range to a single value using a kahan summation algorithm in O(N) operations and O(1) extra memory see https://en.cppreference.com/w/cpp/algorithm/accumulate. More...
 
template<typename Container , typename T = detail::ContainerVal<Container>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container >, std::is_floating_point< T > > RAJA::kahan_sum_volatile (Container &&c, T init=T())
 Accumulate given range to a single value using a kahan summation algorithm in O(N) operations and O(1) extra memory see https://en.cppreference.com/w/cpp/algorithm/accumulate. More...
 
template<typename Container , typename T = detail::ContainerVal<Container>, typename BinaryOp = operators::plus<T>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container > > RAJA::high_accuracy_reduce (Container &&c, T init=BinaryOp::identity(), BinaryOp op=BinaryOp {})
 Reduce given range to a single value using an algorithm with high accuracy when floating point round off is a concern see https://en.cppreference.com/w/cpp/algorithm/reduce. More...
 
template<typename Container , typename T = detail::ContainerVal<Container>, typename BinaryOp = operators::plus<T>>
RAJA_HOST_DEVICE constexpr RAJA_INLINE concepts::enable_if_t< T, type_traits::is_range< Container > > RAJA::accumulate (Container &&c, T init=BinaryOp::identity(), BinaryOp op=BinaryOp {})
 Accumulate given range to a single value using a left fold algorithm in O(N) operations and O(1) extra memory see https://en.cppreference.com/w/cpp/algorithm/accumulate. More...
 

Detailed Description

Header file providing RAJA sort templates.