Classes | Public Types | Public Member Functions | List of all members
cudf::list_device_view Class Reference

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 > >
 
template<typename T >
using const_pair_rep_iterator = thrust::transform_iterator< pair_rep_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.
 
template<typename T >
CUDA_DEVICE_CALLABLE 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 >
CUDA_DEVICE_CALLABLE 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.
 

Detailed Description

A non-owning, immutable view of device data that represents a list of elements of arbitrary type (including further nested lists).

Definition at line 29 of file list_device_view.cuh.

Member Function Documentation

◆ element()

template<typename T >
CUDA_DEVICE_CALLABLE T cudf::list_device_view::element ( size_type  idx) const
inline

Fetches the element at the specified index within the list row.

Template Parameters
Thetype of the list's element.
Parameters
Theindex into the list row
Returns
The element at the specified index of the list row.

Definition at line 86 of file list_device_view.cuh.

◆ element_offset()

CUDA_DEVICE_CALLABLE size_type cudf::list_device_view::element_offset ( size_type  idx) const
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 72 of file list_device_view.cuh.

◆ pair_begin()

template<typename T >
CUDA_DEVICE_CALLABLE const_pair_iterator<T> cudf::list_device_view::pair_begin ( ) const
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],

  1. p.first is the value of the element at i
  2. p.second == true

If the element at index i is null,

  1. p.first is undefined
  2. p.second == false

Definition at line 144 of file list_device_view.cuh.

◆ pair_rep_begin()

template<typename T >
CUDA_DEVICE_CALLABLE const_pair_rep_iterator<T> cudf::list_device_view::pair_rep_begin ( ) const
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],

  1. p.first is the value of the element at i
  2. p.second == true

If the element at index i is null,

  1. p.first is undefined
  2. p.second == false

Definition at line 176 of file list_device_view.cuh.


The documentation for this class was generated from the following file: