A non-owning, immutable view of device data that represents a list of elements of arbitrary type (including further nested lists). More...
Classes | |
struct | pair_accessor |
pair accessor for elements in a list_device_view More... | |
Public Types | |
template<typename T > | |
using | const_pair_iterator = thrust::transform_iterator< pair_accessor< T >, thrust::counting_iterator< cudf::size_type > > |
Public Member Functions | |
CUDA_DEVICE_CALLABLE | list_device_view (lists_column_device_view const &lists_column, size_type const &row_index) |
CUDA_DEVICE_CALLABLE size_type | element_offset (size_type idx) const |
Fetches the offset in the list column's child that corresponds to the element at the specified list index. More... | |
template<typename T > | |
CUDA_DEVICE_CALLABLE T | element (size_type idx) const |
Fetches the element at the specified index within the list row. More... | |
CUDA_DEVICE_CALLABLE bool | is_null (size_type idx) const |
Checks whether element is null at specified index in the list row. | |
CUDA_DEVICE_CALLABLE bool | is_null () const |
Checks whether this list row is null. | |
CUDA_DEVICE_CALLABLE size_type | size () const |
Fetches the number of elements in this list row. | |
CUDA_DEVICE_CALLABLE lists_column_device_view const & | get_column () const |
Fetches the lists_column_device_view that contains this list. | |
template<typename T > | |
CUDA_DEVICE_CALLABLE const_pair_iterator< T > | pair_begin () const |
Fetcher for a pair iterator to the first element in the list_device_view. More... | |
template<typename T > | |
CUDA_DEVICE_CALLABLE const_pair_iterator< T > | pair_end () const |
Fetcher for a pair iterator to one position past the last element in the list_device_view. | |
A non-owning, immutable view of device data that represents a list of elements of arbitrary type (including further nested lists).
Definition at line 28 of file list_device_view.cuh.
|
inline |
Fetches the element at the specified index within the list row.
The | type of the list's element. |
The | index into the list row |
Definition at line 85 of file list_device_view.cuh.
|
inline |
Fetches the offset in the list column's child that corresponds to the element at the specified list index.
Consider the following lists column: [ [0,1,2], [3,4,5], [6,7,8] ]
The list's internals would look like: offsets: [0, 3, 6, 9] child : [0, 1, 2, 3, 4, 5, 6, 7, 8]
The second list row (i.e. row_index=1) is [3,4,5]. The third element (i.e. idx=2) of the second list row is 5.
The offset of this element as stored in the child column (i.e. 5) may be fetched using this method.
Definition at line 71 of file list_device_view.cuh.
|
inline |
Fetcher for a pair iterator to the first element in the list_device_view.
Dereferencing the returned iterator yields a thrust::pair<T, bool>
.
If the element at index i
is valid, then for p = iter[i]
,
p.first
is the value of the element at i
p.second == true
If the element at index i
is null,
p.first
is undefinedp.second == false
Definition at line 136 of file list_device_view.cuh.