23 #include <type_traits>
60 template<
typename IterType,
typename IndexType>
63 using element_type =
typename std::iterator_traits<IterType>::value_type;
72 static_assert(type_traits::is_integral<IndexType>::value,
73 "IndexType must model Integral");
74 static_assert(type_traits::is_random_access_iterator<IterType>::value,
75 "IterType must model RandomAccessIterator");
167 return static_cast<size_type>(m_end - m_begin);
177 return slice(0, count);
194 auto start = m_begin +
begin;
195 auto end = start + length > m_end ? m_end : start + length;
224 template<
typename IterType,
typename IndexType>
232 template<
typename Iter>
238 return Span<
typename Iter::iterator,
239 decltype(distance(begin(iterable), end(iterable)))>(
240 begin(iterable), end(iterable));
Header file for RAJA concept definitions.
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
Definition: AlignedRangeIndexSetBuilders.cpp:35
constexpr RAJA_HOST_DEVICE RAJA_INLINE Span< IterType, IndexType > make_span(IterType begin, IndexType size)
Creates a span from a random access iterator and length.
Definition: Span.hpp:225
A view to a sequence of objects.
Definition: Span.hpp:62
IterType const_iterator
Definition: Span.hpp:70
constexpr RAJA_HOST_DEVICE RAJA_INLINE Span subspan(size_type begin, size_type length) const
Definition: Span.hpp:185
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend iterator begin(Span &s)
Definition: Span.hpp:111
constexpr RAJA_HOST_DEVICE RAJA_INLINE Span last(size_type count) const
Definition: Span.hpp:180
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend const_iterator cbegin(const Span &s)
Definition: Span.hpp:133
constexpr RAJA_HOST_DEVICE RAJA_INLINE bool empty() const
Definition: Span.hpp:170
constexpr RAJA_HOST_DEVICE RAJA_INLINE const_iterator end() const
Definition: Span.hpp:96
constexpr RAJA_HOST_DEVICE RAJA_INLINE iterator begin()
Definition: Span.hpp:87
constexpr RAJA_HOST_DEVICE Span(iterator begin, iterator end)
Definition: Span.hpp:77
constexpr RAJA_HOST_DEVICE RAJA_INLINE reference operator[](size_type i) const
Definition: Span.hpp:155
constexpr RAJA_HOST_DEVICE RAJA_INLINE size_type size() const
Definition: Span.hpp:165
camp::decay< element_type > value_type
Definition: Span.hpp:64
IterType iterator
Definition: Span.hpp:69
constexpr RAJA_HOST_DEVICE RAJA_INLINE const_iterator cbegin() const
Definition: Span.hpp:101
IndexType size_type
Definition: Span.hpp:65
constexpr RAJA_HOST_DEVICE Span(iterator begin, size_type size)
Definition: Span.hpp:82
constexpr RAJA_HOST_DEVICE RAJA_INLINE Span slice(size_type begin, size_type length) const
Definition: Span.hpp:191
constexpr RAJA_HOST_DEVICE RAJA_INLINE const_iterator cend() const
Definition: Span.hpp:106
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend const_iterator begin(const Span &s)
Definition: Span.hpp:121
constexpr RAJA_HOST_DEVICE RAJA_INLINE const_iterator begin() const
Definition: Span.hpp:91
const element_type & const_reference
Definition: Span.hpp:68
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend const_iterator end(const Span &s)
Definition: Span.hpp:127
typename std::iterator_traits< IterType >::value_type element_type
Definition: Span.hpp:63
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend const_iterator cend(const Span &s)
Definition: Span.hpp:139
constexpr RAJA_HOST_DEVICE RAJA_INLINE reference front() const
Definition: Span.hpp:145
constexpr RAJA_HOST_DEVICE RAJA_INLINE reference back() const
Definition: Span.hpp:150
constexpr RAJA_HOST_DEVICE RAJA_INLINE Span first(size_type count) const
Definition: Span.hpp:175
constexpr RAJA_HOST_DEVICE RAJA_INLINE iterator end()
Definition: Span.hpp:89
constexpr RAJA_HOST_DEVICE RAJA_INLINE friend iterator end(Span &s)
Definition: Span.hpp:116
std::ptrdiff_t difference_type
Definition: Span.hpp:66
element_type & reference
Definition: Span.hpp:67
constexpr RAJA_HOST_DEVICE RAJA_INLINE iterator data() const
Definition: Span.hpp:160