All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Attributes | List of all members
cudf::jit::detail::column_device_view_base Class Reference

A minified version of cudf::detail::column_device_view_base for use in JIT kernels. More...

Inheritance diagram for cudf::jit::detail::column_device_view_base:
cudf::jit::column_device_view cudf::jit::mutable_column_device_view

Public 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...
 
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 Attributes

data_type _type
 Element type. More...
 
size_type _size
 Number of elements. More...
 
void const * _data
 Pointer to device memory containing elements. More...
 
bitmask_type const * _null_mask
 
size_type _offset
 

Detailed Description

A minified version of cudf::detail::column_device_view_base for use in JIT kernels.

Definition at line 30 of file types.cuh.

Constructor & Destructor Documentation

◆ column_device_view_base()

CUDF_HOST_DEVICE cudf::jit::detail::column_device_view_base::column_device_view_base ( data_type  type,
size_type  size,
void const *  data,
bitmask_type const *  null_mask,
size_type  offset 
)
inline

Constructs a column with the specified type, size, data, nullmask and offset.

Parameters
typeThe type of the column
sizeThe number of elements in the column
dataPointer to device memory containing elements
null_maskPointer to device memory containing bitmask representing valid elements
offsetIndex position of the first element

Definition at line 41 of file types.cuh.

Member Function Documentation

◆ data()

template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
CUDF_HOST_DEVICE T const* cudf::jit::detail::column_device_view_base::data ( ) const
inlinenoexcept

Returns the underlying data casted to the specified type, plus the offset.

Note
If 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.

Template Parameters
TThe type to cast to
Returns
Typed pointer to underlying data, including the offset

Definition at line 64 of file types.cuh.

◆ get_mask_word()

bitmask_type cudf::jit::detail::column_device_view_base::get_mask_word ( size_type  word_index) const
inlinenoexcept

Returns the specified bitmask word from the null_mask().

Note
It is undefined behavior to call this function if nullable() == false.
Parameters
word_indexThe index of the word to get
Returns
bitmask word for the given word_index

Definition at line 132 of file types.cuh.

◆ head()

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* cudf::jit::detail::column_device_view_base::head ( ) const
inlinenoexcept

Returns pointer to the base device memory allocation casted to the specified type.

Note
If offset() == 0, then head<T>() == data<T>()
It should be rare to need to access the 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.

Template Parameters
Thetype to cast to
Returns
Typed pointer to underlying data

Definition at line 55 of file types.cuh.

◆ is_null()

bool cudf::jit::detail::column_device_view_base::is_null ( size_type  element_index) const
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.

Note
If nullable() == true can be guaranteed, then it is more performant to use is_null_nocheck().
Parameters
element_indexThe index of the element to query
Returns
true The element is null
false The element is valid

Definition at line 116 of file types.cuh.

◆ is_null_nocheck()

bool cudf::jit::detail::column_device_view_base::is_null_nocheck ( size_type  element_index) const
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.

Parameters
element_indexThe index of the element to query
Returns
true The element is null
false The element is valid

Definition at line 124 of file types.cuh.

◆ is_valid()

bool cudf::jit::detail::column_device_view_base::is_valid ( size_type  element_index) const
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.

Note
If nullable() == true can be guaranteed, then it is more performant to use is_valid_nocheck().
Parameters
element_indexThe index of the element to query
Returns
true The element is valid
false The element is null

Definition at line 100 of file types.cuh.

◆ is_valid_nocheck()

bool cudf::jit::detail::column_device_view_base::is_valid_nocheck ( size_type  element_index) const
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.

Parameters
element_indexThe index of the element to query
Returns
true The element is valid
false The element is null

Definition at line 108 of file types.cuh.

◆ null_mask()

CUDF_HOST_DEVICE bitmask_type const* cudf::jit::detail::column_device_view_base::null_mask ( ) const
inlinenoexcept

Returns raw pointer to the underlying bitmask allocation.

Note
This function does not account for the offset().
If null_count() == 0, this may return nullptr.
Returns
Raw pointer to the underlying bitmask allocation

Definition at line 87 of file types.cuh.

◆ nullable()

CUDF_HOST_DEVICE bool cudf::jit::detail::column_device_view_base::nullable ( ) const
inlinenoexcept

Indicates whether the column can contain null elements, i.e., if it has an allocated bitmask.

Note
If null_count() > 0, this function must always return true.
Returns
true The bitmask is allocated
false The bitmask is not allocated

Definition at line 82 of file types.cuh.

◆ offset()

CUDF_HOST_DEVICE size_type cudf::jit::detail::column_device_view_base::offset ( ) const
inlinenoexcept

Returns the index of the first element relative to the base memory allocation, i.e., what is returned from head<T>().

Returns
The index of the first element relative to the head<T>()

Definition at line 95 of file types.cuh.

◆ size()

CUDF_HOST_DEVICE size_type cudf::jit::detail::column_device_view_base::size ( ) const
inlinenoexcept

Returns the number of elements in the column.

Returns
The number of elements in the column

Definition at line 72 of file types.cuh.

◆ type()

CUDF_HOST_DEVICE data_type cudf::jit::detail::column_device_view_base::type ( ) const
inlinenoexcept

Returns the element type.

Returns
The element type

Definition at line 77 of file types.cuh.

Member Data Documentation

◆ _data

void const* cudf::jit::detail::column_device_view_base::_data
protected

Pointer to device memory containing elements.

Definition at line 151 of file types.cuh.

◆ _null_mask

bitmask_type const* cudf::jit::detail::column_device_view_base::_null_mask
protected

Pointer to device memory containing bitmask representing null elements.

Definition at line 156 of file types.cuh.

◆ _offset

size_type cudf::jit::detail::column_device_view_base::_offset
protected

Index position of the first element. Enables zero-copy slicing

Definition at line 161 of file types.cuh.

◆ _size

size_type cudf::jit::detail::column_device_view_base::_size
protected

Number of elements.

Definition at line 146 of file types.cuh.

◆ _type

data_type cudf::jit::detail::column_device_view_base::_type
protected

Element type.

Definition at line 141 of file types.cuh.


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