cuda::experimental::heterogeneous_iterator#
-
template<class _CvTp, class ..._Properties>
class heterogeneous_iterator : public cuda::experimental::__heterogeneous_iterator_access<::cuda::std::remove_const_t<_CvTp>, ::cuda::std::is_const_v<_CvTp> ? _IsConstIter::__yes : _IsConstIter::__no, __select_execution_space<_Properties...>># Type safe iterator over heterogeneous memory#
heterogeneous_iterator
provides a type safe access over heterogeneous memory. Depending on whether the memory is tagged as host-accessible and / or device-accessible the iterator restricts memory access. All operations that do not require memory access are always available on host and device.- Template Parameters:
_Tp – The underlying type of the elements the
heterogeneous_iterator
points at._IsConst – Enumeration choosing whether the
heterogeneous_iterator
allows mutating the element pointed to._Properties – The properties that the
heterogeneous_iterator
is tagged with.
Public Types
-
using iterator_concept = ::cuda::std::contiguous_iterator_tag#
-
using iterator_category = ::cuda::std::random_access_iterator_tag#
-
using difference_type = ::cuda::std::ptrdiff_t#
Public Functions
-
heterogeneous_iterator() = default#
-
inline constexpr heterogeneous_iterator(pointer __ptr) noexcept#
Construct a
heterogeneous_iterator
from a pointer to the underlying memory.
-
template<class _OtherTp, ::cuda::std::enable_if_t<(::cuda::std::is_same_v<_OtherTp, value_type>)&&(::cuda::std::is_const_v<_CvTp>), int> = 0>
inline constexpr heterogeneous_iterator( - heterogeneous_iterator<_OtherTp, _Properties...> __other,
Constructs an immutable
heterogeneous_iterator
from a mutable one.- Parameters:
__other – The mutable
heterogeneous_iterator
-
inline constexpr heterogeneous_iterator &operator++() noexcept#
Increment of a
heterogeneous_iterator
.- Returns:
The heterogeneous_iterator pointing to the next element
-
inline constexpr heterogeneous_iterator operator++(int) noexcept#
Post-increment of a
heterogeneous_iterator
.- Returns:
A copy of the heterogeneous_iterator pointing to the next element
-
inline constexpr heterogeneous_iterator &operator--() noexcept#
Decrement of a
heterogeneous_iterator
.- Returns:
The heterogeneous_iterator pointing to the previous element
-
inline constexpr heterogeneous_iterator operator--(int) noexcept#
Post-decrement of a
heterogeneous_iterator
.- Returns:
A copy of the heterogeneous_iterator pointing to the previous element
- inline constexpr heterogeneous_iterator &operator+=(
- const difference_type __count,
Advance a
heterogeneous_iterator
.- Parameters:
__count – The number of elements to advance.
- Returns:
The heterogeneous_iterator advanced by
__count
- inline constexpr heterogeneous_iterator operator+(
- const difference_type __count,
Advance a
heterogeneous_iterator
.- Parameters:
__count – The number of elements to advance.
- Returns:
A copy of this heterogeneous_iterator advanced by
__count
- inline constexpr heterogeneous_iterator &operator-=(
- const difference_type __count,
Advance a
heterogeneous_iterator
by the negative value of__count
.- Parameters:
__count – The number of elements to advance.
- Returns:
The heterogeneous_iterator advanced by the negative value of
__count
- inline constexpr heterogeneous_iterator operator-(
- const difference_type __count,
Advance a
heterogeneous_iterator
by the negative value of__count
.- Parameters:
__count – The number of elements to advance.
- Returns:
A copy of this heterogeneous_iterator advanced by the negative value of
__count
- inline constexpr difference_type operator-(
- const heterogeneous_iterator &__other,
Distance between two heterogeneous_iterator.
- Parameters:
__other – The other heterogeneous_iterator.
- Returns:
The distance between the two elements the heterogeneous_iterator point to