5#include "AMReX_Vector.H"
31 explicit Slice(T* pbegin,
const size_t n)
37 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
reference
66slice(std::vector<T>& vec,
const size_t start,
const size_t count)
68 AMREX_ASSERT((start + count) <= vec.size());
75 AMREX_ASSERT(start < vec.size());
76 return slice(vec, start, vec.size() - start);
81slice(amrex::Vector<T>& vec,
const size_t start,
const size_t count)
83 AMREX_ASSERT((start + count) <=
static_cast<size_t>(vec.size()));
90 AMREX_ASSERT(start <
static_cast<size_t>(vec.size()));
91 return slice(vec, start, vec.size() - start);
96slice(amrex::Gpu::DeviceVector<T>& vec,
const size_t start,
const size_t count)
98 AMREX_ASSERT((start + count) <=
static_cast<size_t>(vec.size()));
99 return Slice<T>{(vec.data() + start), count};
105 AMREX_ASSERT(start <
static_cast<size_t>(vec.size()));
106 return slice(vec, start, vec.size() - start);
Definition MultiParser.H:7
Slice< T > slice(std::vector< T > &vec, const size_t start, const size_t count)
Definition Slice.H:66
AMREX_GPU_HOST_DEVICE const_iterator cbegin() const
Definition Slice.H:60
T * pointer
Definition Slice.H:18
AMREX_GPU_HOST_DEVICE const_iterator cend() const
Definition Slice.H:61
pointer ptr_begin
Definition Slice.H:26
const T * const_iterator
Definition Slice.H:23
AMREX_GPU_HOST_DEVICE const_iterator end() const
Definition Slice.H:59
std::size_t size_type
Definition Slice.H:15
Slice(T *pbegin, const size_t n)
Definition Slice.H:31
AMREX_GPU_HOST_DEVICE pointer data()
Definition Slice.H:54
T value_type
Definition Slice.H:13
Slice(T *pbegin, T *pend)
Definition Slice.H:35
AMREX_GPU_HOST_DEVICE const_iterator begin() const
Definition Slice.H:58
T * iterator
Definition Slice.H:19
AMREX_GPU_HOST_DEVICE iterator end()
Definition Slice.H:56
std::ptrdiff_t difference_type
Definition Slice.H:16
std::reverse_iterator< iterator > reverse_iterator
Definition Slice.H:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const_reference operator[](const size_type idx) const
Definition Slice.H:44
AMREX_GPU_HOST_DEVICE iterator begin()
Definition Slice.H:55
AMREX_GPU_HOST_DEVICE size_type size() const
Definition Slice.H:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE reference operator[](const size_t idx)
Definition Slice.H:38
AMREX_GPU_HOST_DEVICE const_iterator data() const
Definition Slice.H:57
Slice()
Definition Slice.H:29
const T * const_pointer
Definition Slice.H:22
std::size_t size_t
Definition Slice.H:14
pointer ptr_end
Definition Slice.H:27
const std::reverse_iterator< iterator > const_reverse_iterator
Definition Slice.H:24
const T & const_reference
Definition Slice.H:21
T & reference
Definition Slice.H:17