span: One-dimensional Non-owning View#
#include <raft/core/span.hpp>
-
using element_type = T#
-
using value_type = typename std::remove_cv<T>::type#
-
using size_type = std::size_t#
-
using difference_type = std::ptrdiff_t#
-
using pointer = T*#
-
using const_pointer = T const*#
-
using reference = T&#
-
using const_reference = T const&#
-
using const_iterator = const_pointer#
-
using const_reverse_iterator = cuda::std::reverse_iterator<const_iterator>#
-
constexpr span() noexcept = default#
Default constructor that constructs a span with size 0 and nullptr.
-
inline constexpr span(pointer ptr, size_type count) noexcept#
Constructs a span that is a view over the range [first, first + count);.
-
inline constexpr span(pointer first, pointer last) noexcept#
Constructs a span that is a view over the range [first, last)
-
template<std::size_t N>
inline constexpr span( - element_type (&arr)[N]
Constructs a span that is a view over the array arr.
-
template<class U, std::size_t OtherExtent, class = typename std::enable_if<detail::is_allowed_element_type_conversion_t<U, T>::value && detail::is_allowed_extent_conversion_t<OtherExtent, Extent>::value>>
inline constexpr span( - const span<U, is_device, OtherExtent> &other
Initialize a span class from another one who’s underlying type is convertible to element_type.
- span &=default operator= (span const &other) noexcept
- span &=default operator= (span &&other) noexcept
-
inline const_iterator cbegin() const noexcept#
-
inline const_iterator cend() const noexcept#
- inline _RAFT_HOST_DEVICE constexpr auto rbegin () const noexcept -> reverse_iterator
- inline _RAFT_HOST_DEVICE constexpr auto rend () const noexcept -> reverse_iterator
- inline _RAFT_HOST_DEVICE constexpr auto crbegin () const noexcept -> const_reverse_iterator
- inline _RAFT_HOST_DEVICE constexpr auto crend () const noexcept -> const_reverse_iterator
-
inline auto empty() const noexcept#
-
template<std::size_t Count>
inline span<element_type, is_device, Count> first(
- inline span<element_type, is_device, dynamic_extent> first(
- std::size_t _count
-
template<std::size_t Count>
inline span<element_type, is_device, Count> last(
- inline span<element_type, is_device, dynamic_extent> last(
- std::size_t _count
-
template<std::size_t Offset, std::size_t Count = dynamic_extent>
inline span<element_type, is_device, detail::extent_value_t<Extent, Offset, Count>::value> subspan( If Count is std::dynamic_extent, r.size() == this->size() - Offset; Otherwise r.size() == Count.
- inline span<element_type, is_device, dynamic_extent> subspan( ) const#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
bool operator==(
)#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
auto operator!=(
)#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
auto operator<(
)#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
auto operator<=(
)#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
auto operator>(
)#
-
template<class T, std::size_t X, class U, std::size_t Y, bool is_device>
auto operator>=(
)#
-
template<class T, bool is_device, std::size_t E>
span<const std::byte, is_device, detail::extent_as_bytes_value_t<T, E>::value> as_bytes(
) noexcept# Converts a span into a view of its underlying bytes.
-
template<class T, bool is_device, std::size_t E>
span<std::byte, is_device, detail::extent_as_bytes_value_t<T, E>::value> as_writable_bytes(
) noexcept# Converts a span into a mutable view of its underlying bytes.
-
template<typename T, bool is_device, std::size_t Extent = dynamic_extent>
class span# - #include <span.hpp>
The span class defined in ISO C++20. Iterator is defined as plain pointer and most of the methods have bound check on debug build.
rmm::device_uvector<float> uvec(10, rmm::cuda_stream_default); auto view = device_span<float>{uvec.data(), uvec.size()};
#include <raft/core/device_span.hpp>
-
template<typename T, size_t extent = cuda::std::dynamic_extent>
using device_span = span<T, true, extent># A span class for device pointer.
#include <raft/core/host_span.hpp>