An immutable, non-owning view of device data as a column of elements that is trivially copyable and usable in CUDA device code. More...
Classes | |
struct | has_element_accessor_impl |
struct | has_element_accessor_impl< C, T, void_t< decltype(cuda::std::declval< C >().template element< T >(cuda::std::declval< size_type >()))> > |
Public Member Functions | |
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_base & | operator= (column_device_view_base const &)=default |
Copy assignment operator. More... | |
column_device_view_base & | operator= (column_device_view_base &&)=default |
Move assignment operator. More... | |
template<typename T = void, CUDF_ENABLE_IF(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_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 | |
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 {} |
An immutable, non-owning view of device data as a column of elements that is trivially copyable and usable in CUDA device code.
column_device_view_base and derived classes do not support has_nulls() or null_count(). The primary reason for this is that creation of column_device_views from column_views that have UNKNOWN null counts would require an on-the-spot, and not-obvious computation of null count, which could lead to undesirable performance issues. This information is also generally not needed in device code, and on the host-side is easily accessible from the associated column_view.
Definition at line 102 of file column_device_view.cuh.
|
inlineprotected |
Constructs a column with the specified type, size, data, nullmask and offset.
type | The type of the column |
size | The number of elements in the column |
data | Pointer to device memory containing elements |
null_mask | Pointer to device memory containing bitmask representing valid elements |
offset | Index position of the first element |
Definition at line 314 of file column_device_view.cuh.
|
inlinenoexcept |
Returns the underlying data casted to the specified type, plus the offset.
offset() == 0
, then head<T>() == data<T>()
For columns with children, the pointer returned is undefined and should not be used.
This function does not participate in overload resolution if is_rep_layout_compatible<T>
is false.
T | The type to cast to |
Definition at line 160 of file column_device_view.cuh.
|
inlinenoexcept |
Returns the specified bitmask word from the null_mask()
.
nullable() == false
.word_index | The index of the word to get |
Definition at line 291 of file column_device_view.cuh.
|
inlinenoexcept |
Returns pointer to the base device memory allocation casted to the specified type.
offset() == 0
, then head<T>() == data<T>()
head<T>()
allocation of a column, and instead, accessing the elements should be done via data<T>()
.This function will only participate in overload resolution if is_rep_layout_compatible<T>()
or std::is_same_v<T,void>
are true.
The | type to cast to |
Definition at line 139 of file column_device_view.cuh.
|
inlinenoexcept |
Returns whether the specified element is null.
Checks first for the existence of the null bitmask. If nullable() == false
, this function always returns false.
nullable() == true
can be guaranteed, then it is more performant to use is_null_nocheck()
.element_index | The index of the element to query |
Definition at line 261 of file column_device_view.cuh.
|
inlinenoexcept |
Returns whether the specified element is null.
This function does not verify the existence of the bitmask before attempting to read it. Therefore, it is undefined behavior to call this function if nullable() == false
.
element_index | The index of the element to query |
Definition at line 277 of file column_device_view.cuh.
|
inlinenoexcept |
Returns whether the specified element holds a valid value (i.e., not null).
Checks first for the existence of the null bitmask. If nullable() == false
, this function always returns true.
nullable() == true
can be guaranteed, then it is more performant to use is_valid_nocheck()
.element_index | The index of the element to query |
Definition at line 226 of file column_device_view.cuh.
|
inlinenoexcept |
Returns whether the specified element holds a valid value (i.e., not null)
This function does not verify the existence of the bitmask before attempting to read it. Therefore, it is undefined behavior to call this function if nullable() == false
.
element_index | The index of the element to query |
Definition at line 243 of file column_device_view.cuh.
|
inlinenoexcept |
Returns raw pointer to the underlying bitmask allocation.
offset()
.null_count() == 0
, this may return nullptr
.Definition at line 199 of file column_device_view.cuh.
|
inlinenoexcept |
Indicates whether the column can contain null elements, i.e., if it has an allocated bitmask.
null_count() > 0
, this function must always return true
.Definition at line 188 of file column_device_view.cuh.
|
inlinenoexcept |
Returns the index of the first element relative to the base memory allocation, i.e., what is returned from head<T>()
.
head<T>()
Definition at line 210 of file column_device_view.cuh.
|
default |
Move assignment operator.
|
default |
Copy assignment operator.
|
inlinenoexcept |
Returns the number of elements in the column.
Definition at line 170 of file column_device_view.cuh.
|
inlinenoexcept |
Returns the element type.
Definition at line 177 of file column_device_view.cuh.
|
protected |
Pointer to device memory containing bitmask representing null elements.
Definition at line 300 of file column_device_view.cuh.
|
protected |
Index position of the first element. Enables zero-copy slicing
Definition at line 302 of file column_device_view.cuh.