21 #ifndef RAJA_INDEXLAYOUT_HPP
22 #define RAJA_INDEXLAYOUT_HPP
34 template<
typename IdxLin = Index_type>
39 const IdxLin idx)
const
51 template<
typename IdxLin = Index_type>
58 const IdxLin idx)
const
71 template<
typename IdxLin = Index_type>
78 const IdxLin idx)
const
94 template<
typename Range,
typename IdxLin,
typename... IndexTypes>
97 template<camp::idx_t... RangeInts,
typename IdxLin,
typename... IndexTypes>
105 static constexpr
size_t n_dims =
sizeof...(RangeInts);
109 template<
typename... Types>
111 camp::tuple<IndexTypes...> index_tuple_in,
114 tuple(index_tuple_in)
124 template<
typename... Indices>
126 Indices... indices)
const
129 (base_.strides[RangeInts] * camp::get<RangeInts>(tuple)(indices))...);
139 return base_.size_noproj();
142 template<camp::
idx_t DIM>
145 return base_.template get_dim_stride<DIM>();
148 template<camp::
idx_t DIM>
151 return base_.template get_dim_size<DIM>();
157 template<
size_t n_dims = 1,
159 typename... IndexTypes>
162 IndexLayout_impl<camp::make_idx_seq_t<n_dims>, IdxLin, IndexTypes...>
165 IndexLayout_impl<camp::make_idx_seq_t<n_dims>, IdxLin, IndexTypes...>;
169 IndexTypes...>::IndexLayout_impl;
184 template<
typename... IndexTypes>
186 -> camp::tuple<IndexTypes...>
188 return camp::tuple<IndexTypes...>(it...);
197 typename... IndexTypes>
199 camp::tuple<IndexTypes...> index_tuple_in,
200 Types... ns) ->
IndexLayout<
sizeof...(Types), IdxLin, IndexTypes...>
202 static_assert(
sizeof...(Types) ==
sizeof...(IndexTypes),
"");
203 return IndexLayout<
sizeof...(Types), IdxLin, IndexTypes...>(index_tuple_in,
RAJA header file defining Layout, a N-dimensional index calculator.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
Definition: AlignedRangeIndexSetBuilders.cpp:35
RAJA_INLINE RAJA_HOST_DEVICE auto make_index_tuple(IndexTypes... it) -> camp::tuple< IndexTypes... >
Definition: IndexLayout.hpp:185
std::ptrdiff_t Index_type
Definition: types.hpp:226
RAJA_INLINE RAJA_HOST_DEVICE auto make_index_layout(camp::tuple< IndexTypes... > index_tuple_in, Types... ns) -> IndexLayout< sizeof...(Types), IdxLin, IndexTypes... >
Definition: IndexLayout.hpp:198
Definition: IndexLayout.hpp:73
IdxLin * index_list
Definition: IndexLayout.hpp:75
IdxLin RAJA_INLINE constexpr RAJA_HOST_DEVICE operator()(const IdxLin idx) const
Definition: IndexLayout.hpp:77
Definition: IndexLayout.hpp:36
IdxLin RAJA_INLINE constexpr RAJA_HOST_DEVICE operator()(const IdxLin idx) const
Definition: IndexLayout.hpp:38
Definition: IndexLayout.hpp:163
constexpr RAJA_INLINE RAJA_HOST_DEVICE IndexLayout(const internal::IndexLayout_impl< camp::make_idx_seq_t< n_dims >, IdxLin, IndexTypes... > &rhs)
Definition: IndexLayout.hpp:172
Definition: IndexLayout.hpp:53
IdxLin * index_list
Definition: IndexLayout.hpp:55
IdxLin RAJA_INLINE constexpr RAJA_HOST_DEVICE operator()(const IdxLin idx) const
Definition: IndexLayout.hpp:57
RAJA_INLINE constexpr RAJA_HOST_DEVICE IndexLinear size() const
Definition: IndexLayout.hpp:132
RAJA_INLINE constexpr RAJA_HOST_DEVICE IndexLinear size_noproj() const
Definition: IndexLayout.hpp:137
Base base_
Definition: IndexLayout.hpp:103
camp::tuple< IndexTypes... > tuple
Definition: IndexLayout.hpp:107
RAJA_INLINE constexpr RAJA_HOST_DEVICE IndexLinear get_dim_size() const
Definition: IndexLayout.hpp:149
RAJA_INLINE constexpr RAJA_HOST_DEVICE IndexLinear get_dim_stride() const
Definition: IndexLayout.hpp:143
constexpr RAJA_INLINE IndexLayout_impl(camp::tuple< IndexTypes... > index_tuple_in, Types... ns)
Definition: IndexLayout.hpp:110
RAJA_INLINE constexpr RAJA_HOST_DEVICE IdxLin operator()(Indices... indices) const
Definition: IndexLayout.hpp:125
IdxLin IndexLinear
Definition: IndexLayout.hpp:101
camp::idx_seq< RangeInts... > IndexRange
Definition: IndexLayout.hpp:100
Definition: IndexLayout.hpp:95