22 #ifndef RAJA_pattern_detail_algorithm_HPP
23 #define RAJA_pattern_detail_algorithm_HPP
25 #include "RAJA/config.hpp"
27 #include "camp/helpers.hpp"
37 template<
typename Iter>
38 using IterVal = typename ::std::iterator_traits<Iter>::value_type;
40 template<
typename Iter>
41 using IterRef = typename ::std::iterator_traits<Iter>::reference;
43 template<
typename Iter>
44 using IterDiff = typename ::std::iterator_traits<Iter>::difference_type;
46 template<
typename Container>
49 template<
typename Container>
51 camp::decay<decltype(*camp::val<camp::iterator_from<Container>>())>;
53 template<
typename Container>
54 using ContainerRef = decltype(*camp::val<camp::iterator_from<Container>>());
56 template<
typename Container>
58 camp::decay<decltype(camp::val<camp::iterator_from<Container>>() -
59 camp::val<camp::iterator_from<Container>>())>;
61 template<
typename DiffType,
typename CountType>
63 CountType num_threads,
66 return (
static_cast<size_t>(n) * thread_id) / num_threads;
74 template<
typename Iter>
77 #ifdef RAJA_GPU_DEVICE_COMPILE_PASS_ACTIVE
78 using camp::safe_swap;
79 safe_swap(*lhs, *rhs);
89 template<
typename Iter>
99 template<
typename Iter>
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
camp::decay< decltype(*camp::val< camp::iterator_from< Container > >())> ContainerVal
Definition: algorithm.hpp:51
camp::iterator_from< Container > ContainerIter
Definition: algorithm.hpp:47
camp::decay< decltype(camp::val< camp::iterator_from< Container > >() - camp::val< camp::iterator_from< Container > >())> ContainerDiff
Definition: algorithm.hpp:59
decltype(*camp::val< camp::iterator_from< Container > >()) ContainerRef
Definition: algorithm.hpp:54
typename ::std::iterator_traits< Iter >::reference IterRef
Definition: algorithm.hpp:41
typename ::std::iterator_traits< Iter >::difference_type IterDiff
Definition: algorithm.hpp:44
typename ::std::iterator_traits< Iter >::value_type IterVal
Definition: algorithm.hpp:38
RAJA_INLINE DiffType firstIndex(DiffType n, CountType num_threads, CountType thread_id)
Definition: algorithm.hpp:62
Definition: AlignedRangeIndexSetBuilders.cpp:35
RAJA_HOST_DEVICE RAJA_INLINE Iter next(Iter it)
returns iterator to next item
Definition: algorithm.hpp:90
RAJA_HOST_DEVICE RAJA_INLINE void safe_iter_swap(Iter lhs, Iter rhs)
swap values at iterators lhs and rhs
Definition: algorithm.hpp:75
RAJA_HOST_DEVICE RAJA_INLINE Iter prev(Iter it)
returns iterator to next item
Definition: algorithm.hpp:100