Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cudf::column_device_view_core Class Reference

An immutable, non-owning view of device data as a column of elements that is trivially copyable and usable in CUDA device code and offline-compiled code (i.e. NVRTC). More...

Inheritance diagram for cudf::column_device_view_core:
cudf::detail::column_device_view_base cudf::column_device_view cudf::detail::lists_column_device_view cudf::detail::structs_column_device_view

Public Member Functions

 column_device_view_core (column_device_view_core const &)=default
 Copy constructor.
 
 column_device_view_core (column_device_view_core &&)=default
 Move constructor.
 
column_device_view_coreoperator= (column_device_view_core const &)=default
 Copy assignment operator. More...
 
column_device_view_coreoperator= (column_device_view_core &&)=default
 Move assignment operator. More...
 
 column_device_view_core (column_view column, void *h_ptr, void *d_ptr)
 Creates an instance of this class using the specified host memory pointer (h_ptr) to store child objects and the device memory pointer (d_ptr) as a base for any child object pointers. More...
 
CUDF_HOST_DEVICE column_device_view_core slice (size_type offset, size_type size) const noexcept
 Get a new raw_column_device_view which is a slice of this column. More...
 
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
element (size_type element_index) const noexcept
 Returns reference to element at the specified index. More...
 
template<typename T , CUDF_ENABLE_IF(cuda::std::is_same_v< T, string_view >) >
element (size_type element_index) const noexcept
 Returns string_view to the string element at the specified index. More...
 
template<typename T , CUDF_ENABLE_IF(cudf::is_fixed_point< T >()) >
element (size_type element_index) const noexcept
 Returns a numeric::fixed_point element at the specified index for a fixed_point column. More...
 
column_device_view_core child (size_type child_index) const noexcept
 Returns the specified child. More...
 
CUDF_HOST_DEVICE size_type num_child_columns () const noexcept
 Returns the number of child columns. More...
 
- Public Member Functions inherited from cudf::detail::column_device_view_base
 column_device_view_base (column_device_view_base const &)=default
 Copy constructor.
 
 column_device_view_base (column_device_view_base &&)=default
 Move constructor.
 
column_device_view_baseoperator= (column_device_view_base const &)=default
 Copy assignment operator. More...
 
column_device_view_baseoperator= (column_device_view_base &&)=default
 Move assignment operator. More...
 
template<typename T = void, CUDF_ENABLE_IF(cuda::std::is_same_v< T, void > or is_rep_layout_compatible< T >()) >
CUDF_HOST_DEVICE T const * head () const noexcept
 Returns pointer to the base device memory allocation casted to the specified type. More...
 
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
CUDF_HOST_DEVICE T const * data () const noexcept
 Returns the underlying data casted to the specified type, plus the offset. More...
 
CUDF_HOST_DEVICE size_type size () const noexcept
 Returns the number of elements in the column. More...
 
CUDF_HOST_DEVICE data_type type () const noexcept
 Returns the element type. More...
 
CUDF_HOST_DEVICE bool nullable () const noexcept
 Indicates whether the column can contain null elements, i.e., if it has an allocated bitmask. More...
 
CUDF_HOST_DEVICE bitmask_type const * null_mask () const noexcept
 Returns raw pointer to the underlying bitmask allocation. More...
 
CUDF_HOST_DEVICE size_type offset () const noexcept
 Returns the index of the first element relative to the base memory allocation, i.e., what is returned from head<T>(). More...
 
bool is_valid (size_type element_index) const noexcept
 Returns whether the specified element holds a valid value (i.e., not null). More...
 
bool is_valid_nocheck (size_type element_index) const noexcept
 Returns whether the specified element holds a valid value (i.e., not null) More...
 
bool is_null (size_type element_index) const noexcept
 Returns whether the specified element is null. More...
 
bool is_null_nocheck (size_type element_index) const noexcept
 Returns whether the specified element is null. More...
 
bitmask_type get_mask_word (size_type word_index) const noexcept
 Returns the specified bitmask word from the null_mask(). More...
 

Protected Member Functions

CUDF_HOST_DEVICE column_device_view_core (data_type type, size_type size, void const *data, bitmask_type const *null_mask, size_type offset, column_device_view_core *children, size_type num_children)
 Creates an instance of this class using pre-existing device memory pointers to data, nullmask, and offset. More...
 
- Protected Member Functions inherited from cudf::detail::column_device_view_base
CUDF_HOST_DEVICE column_device_view_base (data_type type, size_type size, void const *data, bitmask_type const *null_mask, size_type offset)
 Constructs a column with the specified type, size, data, nullmask and offset. More...
 

Protected Attributes

column_device_view_cored_children {}
 
size_type _num_children {}
 The number of child columns.
 
- Protected Attributes inherited from cudf::detail::column_device_view_base
data_type _type {type_id::EMPTY}
 Element type.
 
cudf::size_type _size {}
 Number of elements.
 
void const * _data {}
 Pointer to device memory containing elements.
 
bitmask_type const * _null_mask {}
 
size_type _offset {}
 

Additional Inherited Members

- Static Public Attributes inherited from cudf::detail::column_device_view_base
static constexpr size_type offsets_column_index {0}
 Child index of the offsets column.
 

Detailed Description

An immutable, non-owning view of device data as a column of elements that is trivially copyable and usable in CUDA device code and offline-compiled code (i.e. NVRTC).

Definition at line 344 of file column_device_view_base.cuh.

Constructor & Destructor Documentation

◆ column_device_view_core() [1/2]

cudf::column_device_view_core::column_device_view_core ( column_view  column,
void *  h_ptr,
void *  d_ptr 
)

Creates an instance of this class using the specified host memory pointer (h_ptr) to store child objects and the device memory pointer (d_ptr) as a base for any child object pointers.

Parameters
columnColumn view from which to create this instance.
h_ptrHost memory pointer on which to place any child data.
d_ptrDevice memory pointer on which to base any child pointers.

◆ column_device_view_core() [2/2]

CUDF_HOST_DEVICE cudf::column_device_view_core::column_device_view_core ( data_type  type,
size_type  size,
void const *  data,
bitmask_type const *  null_mask,
size_type  offset,
column_device_view_core children,
size_type  num_children 
)
inlineprotected

Creates an instance of this class using pre-existing device memory pointers to data, nullmask, and offset.

Parameters
typeThe type of the column
sizeThe number of elements in the column
dataPointer to the device memory containing the data
null_maskPointer to the device memory containing the null bitmask
offsetThe index of the first element in the column
childrenPointer to the device memory containing child data
num_childrenThe number of child columns

Definition at line 501 of file column_device_view_base.cuh.

Member Function Documentation

◆ child()

column_device_view_core cudf::column_device_view_core::child ( size_type  child_index) const
inlinenoexcept

Returns the specified child.

Parameters
child_indexThe index of the desired child
Returns
column_view The requested child column_view

Definition at line 473 of file column_device_view_base.cuh.

◆ element() [1/3]

template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
T cudf::column_device_view_core::element ( size_type  element_index) const
inlinenoexcept

Returns reference to element at the specified index.

If the element at the specified index is NULL, i.e., is_null(element_index) == true, then any attempt to use the result will lead to undefined behavior.

This function accounts for the offset.

This function does not participate in overload resolution if is_rep_layout_compatible<T> is false. Specializations of this function may exist for types T where is_rep_layout_compatible<T> is false.

Template Parameters
TThe element type
Parameters
element_indexPosition of the desired element
Returns
reference to the element at the specified index

Definition at line 420 of file column_device_view_base.cuh.

◆ element() [2/3]

template<typename T , CUDF_ENABLE_IF(cuda::std::is_same_v< T, string_view >) >
T cudf::column_device_view_core::element ( size_type  element_index) const
inlinenoexcept

Returns string_view to the string element at the specified index.

If the element at the specified index is NULL, i.e., is_null(element_index) == true, then any attempt to use the result will lead to undefined behavior.

This function accounts for the offset.

Parameters
element_indexPosition of the desired string element
Returns
string_view instance representing this element at this index

Definition at line 437 of file column_device_view_base.cuh.

◆ element() [3/3]

template<typename T , CUDF_ENABLE_IF(cudf::is_fixed_point< T >()) >
T cudf::column_device_view_core::element ( size_type  element_index) const
inlinenoexcept

Returns a numeric::fixed_point element at the specified index for a fixed_point column.

If the element at the specified index is NULL, i.e., is_null(element_index) == true, then any attempt to use the result will lead to undefined behavior.

Parameters
element_indexPosition of the desired element
Returns
numeric::fixed_point representing the element at this index

Definition at line 459 of file column_device_view_base.cuh.

◆ num_child_columns()

CUDF_HOST_DEVICE size_type cudf::column_device_view_core::num_child_columns ( ) const
inlinenoexcept

Returns the number of child columns.

Returns
The number of child columns

Definition at line 483 of file column_device_view_base.cuh.

◆ operator=() [1/2]

column_device_view_core& cudf::column_device_view_core::operator= ( column_device_view_core &&  )
default

Move assignment operator.

Returns
Reference to this object (after transferring ownership)

◆ operator=() [2/2]

column_device_view_core& cudf::column_device_view_core::operator= ( column_device_view_core const &  )
default

Copy assignment operator.

Returns
Reference to this object

◆ slice()

CUDF_HOST_DEVICE column_device_view_core cudf::column_device_view_core::slice ( size_type  offset,
size_type  size 
) const
inlinenoexcept

Get a new raw_column_device_view which is a slice of this column.

Example:

// column = raw_column_device_view([1, 2, 3, 4, 5, 6, 7])
auto c = column.slice(1, 3);
// c = raw_column_device_view([2, 3, 4])
auto c1 = column.slice(2, 3);
// c1 = raw_column_device_view([3, 4, 5])
Parameters
offsetThe index of the first element in the slice
sizeThe number of elements in the slice
Returns
A slice of this column

Definition at line 390 of file column_device_view_base.cuh.

Member Data Documentation

◆ d_children

column_device_view_core* cudf::column_device_view_core::d_children {}
protected

Array of raw_column_device_view objects in device memory. Based on element type, children may contain additional data

Definition at line 515 of file column_device_view_base.cuh.


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