libcudf
23.12.00
|
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... | |
struct | pair_rep_accessor |
pair rep 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 > > |
const pair iterator for the list | |
template<typename T > | |
using | const_pair_rep_iterator = thrust::transform_iterator< pair_rep_accessor< T >, thrust::counting_iterator< cudf::size_type > > |
const pair iterator type for the list | |
Public Member Functions | |
list_device_view (lists_column_device_view const &lists_column, size_type const &row_index) | |
Constructs a list_device_view from a list column and index. More... | |
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 > | |
T | element (size_type idx) const |
Fetches the element at the specified index within the list row. More... | |
bool | is_null (size_type idx) const |
Checks whether the element is null at the specified index in the list. More... | |
bool | is_null () const |
Checks whether this list row is null. More... | |
size_type | size () const |
Fetches the number of elements in this list row. More... | |
size_type | row_index () const |
Returns the row index of this list in the original lists column. More... | |
lists_column_device_view const & | get_column () const |
Fetches the lists_column_device_view that contains this list. More... | |
template<typename T > | |
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 > | |
const_pair_iterator< T > | pair_end () const |
Fetcher for a pair iterator to one position past the last element in the list_device_view. More... | |
template<typename T > | |
const_pair_rep_iterator< T > | pair_rep_begin () const |
Fetcher for a pair iterator to the first element in the list_device_view. More... | |
template<typename T > | |
const_pair_rep_iterator< T > | pair_rep_end () const |
Fetcher for a pair iterator to one position past the last element in the list_device_view. More... | |
A non-owning, immutable view of device data that represents a list of elements of arbitrary type (including further nested lists).
Definition at line 34 of file list_device_view.cuh.
|
inline |
Constructs a list_device_view from a list column and index.
lists_column | list column device view containing the list to view |
row_index | index of the list row to view |
Definition at line 46 of file list_device_view.cuh.
|
inline |
Fetches the element at the specified index within the list row.
T | The type of the list's element. |
idx | The index into the list row |
Definition at line 100 of file list_device_view.cuh.
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.
idx | The list index of the element to fetch the offset for |
Definition at line 86 of file list_device_view.cuh.
|
inline |
Fetches the lists_column_device_view that contains this list.
Definition at line 144 of file list_device_view.cuh.
|
inline |
Checks whether this list row is null.
true
if this list is null Definition at line 123 of file list_device_view.cuh.
|
inline |
Checks whether the element is null at the specified index in the list.
idx | The index into the list row |
true
if the element is null at the specified index in the list row Definition at line 111 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 182 of file list_device_view.cuh.
|
inline |
Fetcher for a pair iterator to one position past the last element in the list_device_view.
Definition at line 195 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<rep_type, bool>
, where rep_type
is device_storage_type_t<T>
, the type used to store the value on the device.
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 220 of file list_device_view.cuh.
|
inline |
Fetcher for a pair iterator to one position past the last element in the list_device_view.
Definition at line 234 of file list_device_view.cuh.
|
inline |
Returns the row index of this list in the original lists column.
Definition at line 137 of file list_device_view.cuh.
|
inline |
Fetches the number of elements in this list row.
Definition at line 130 of file list_device_view.cuh.