A container of nullable device data as a column of elements. More...
#include <column.hpp>
Classes | |
struct | contents |
Wrapper for the contents of a column. More... | |
Public Member Functions | |
column & | operator= (column const &other)=delete |
column & | operator= (column &&other)=delete |
column (column const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new column object by deep copying the contents of other . More... | |
column (column &&other) noexcept | |
Move the contents from other to create a new column. More... | |
template<typename T , CUDF_ENABLE_IF(cudf::is_numeric< T >() or cudf::is_chrono< T >()) > | |
column (rmm::device_uvector< T > &&other, rmm::device_buffer &&null_mask, size_type null_count) | |
Construct a new column by taking ownership of the contents of a device_uvector. More... | |
template<typename B1 , typename B2 = rmm::device_buffer> | |
column (data_type dtype, size_type size, B1 &&data, B2 &&null_mask, size_type null_count, std::vector< std::unique_ptr< column >> &&children={}) | |
Construct a new column from existing device memory. More... | |
column (column_view view, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new column by deep copying the contents of a column_view . More... | |
data_type | type () const noexcept |
Returns the column's logical element type. More... | |
size_type | size () const noexcept |
Returns the number of elements. More... | |
size_type | null_count () const |
Returns the count of null elements. More... | |
void | set_null_mask (rmm::device_buffer &&new_null_mask, size_type new_null_count) |
Sets the column's null value indicator bitmask to new_null_mask . More... | |
void | set_null_mask (rmm::device_buffer const &new_null_mask, size_type new_null_count, rmm::cuda_stream_view stream=cudf::get_default_stream()) |
Sets the column's null value indicator bitmask to new_null_mask . More... | |
void | set_null_count (size_type new_null_count) |
Updates the count of null elements. More... | |
bool | nullable () const noexcept |
Indicates whether it is possible for the column to contain null values, i.e., it has an allocated null mask. More... | |
bool | has_nulls () const noexcept |
Indicates whether the column contains null elements. More... | |
size_type | num_children () const noexcept |
Returns the number of child columns. More... | |
column & | child (size_type child_index) noexcept |
Returns a reference to the specified child. More... | |
column const & | child (size_type child_index) const noexcept |
Returns a const reference to the specified child. More... | |
contents | release () noexcept |
Releases ownership of the column's contents. More... | |
std::size_t | alloc_size () const |
Returns the total device allocation size of the column in bytes. More... | |
column_view | view () const |
Creates an immutable, non-owning view of the column's data and children. More... | |
operator column_view () const | |
Implicit conversion operator to a column_view . More... | |
mutable_column_view | mutable_view () |
Creates a mutable, non-owning view of the column's data, null mask, and children. More... | |
operator mutable_column_view () | |
Implicit conversion operator to a mutable_column_view . More... | |
A container of nullable device data as a column of elements.
Definition at line 47 of file column.hpp.
cudf::column::column | ( | column const & | other, |
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new column object by deep copying the contents of other
.
Uses the specified stream
and device_memory_resource for all allocations and copies.
other | The column to copy |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for all device memory allocations |
|
noexcept |
Move the contents from other
to create a new column.
After the move, other.size() == 0
and other.type() = {EMPTY}
other | The column whose contents will be moved into the new column |
|
inline |
Construct a new column by taking ownership of the contents of a device_uvector.
other | The device_uvector whose contents will be moved into the new column. |
null_mask | Column's null value indicator bitmask. May be empty if null_count is 0. |
null_count | The count of null elements. |
Definition at line 86 of file column.hpp.
|
inline |
Construct a new column from existing device memory.
cudf::logic_error | if size < 0 |
dtype | The element type |
size | The number of elements in the column |
data | The column's data |
null_mask | Column's null value indicator bitmask. May be empty if null_count is 0. |
null_count | Optional, the count of null elements. |
children | Optional, vector of child columns |
Definition at line 117 of file column.hpp.
|
explicit |
Construct a new column by deep copying the contents of a column_view
.
This accounts for the column_view
's offset.
view | The view to copy |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for all device memory allocations |
std::size_t cudf::column::alloc_size | ( | ) | const |
Returns the total device allocation size of the column in bytes.
This includes the size of the data buffer, null mask, and any child columns. It also includes any padding bytes and is at least as large as size()*sizeof(T)
for the column's logical type.
Returns a const reference to the specified child.
child_index | Index of the desired child |
Definition at line 249 of file column.hpp.
Returns a reference to the specified child.
child_index | Index of the desired child |
Definition at line 241 of file column.hpp.
|
inlinenoexcept |
Indicates whether the column contains null elements.
Definition at line 226 of file column.hpp.
mutable_column_view cudf::column::mutable_view | ( | ) |
Creates a mutable, non-owning view of the column's data, null mask, and children.
|
inline |
Returns the count of null elements.
Definition at line 166 of file column.hpp.
|
inlinenoexcept |
Indicates whether it is possible for the column to contain null values, i.e., it has an allocated null mask.
This may return false
iff null_count() == 0
.
May return true even if null_count() == 0
. This function simply indicates whether the column has an allocated null mask.
Definition at line 218 of file column.hpp.
|
inlinenoexcept |
Returns the number of child columns.
Definition at line 233 of file column.hpp.
|
inline |
Implicit conversion operator to a column_view
.
This allows passing a column
object directly into a function that requires a column_view
. The conversion is automatic.
column_view
Definition at line 309 of file column.hpp.
|
inline |
Implicit conversion operator to a mutable_column_view
.
This allows passing a column
object into a function that accepts a mutable_column_view
. The conversion is automatic.
The caller is expected to update the null count appropriately if the null mask is modified.
mutable_column_view
Definition at line 330 of file column.hpp.
|
noexcept |
Releases ownership of the column's contents.
It is the caller's responsibility to query the size(), null_count(), type()
before invoking release()
.
After calling release()
on a column it will be empty, i.e.:
type() == data_type{EMPTY}
size() == 0
null_count() == 0
num_children() == 0
contents
struct containing the data, null mask, and children of the column. void cudf::column::set_null_count | ( | size_type | new_null_count | ) |
Updates the count of null elements.
cudf::logic_error | if new_null_count > 0 and nullable() == false |
new_null_count | The new null count. |
void cudf::column::set_null_mask | ( | rmm::device_buffer && | new_null_mask, |
size_type | new_null_count | ||
) |
Sets the column's null value indicator bitmask to new_null_mask
.
cudf::logic_error | if new_null_count is larger than 0 and the size of new_null_mask does not match the size of this column. |
new_null_mask | New null value indicator bitmask (rvalue overload & moved) to set the column's null value indicator mask. May be empty if new_null_count is 0. |
new_null_count | The count of null elements. |
void cudf::column::set_null_mask | ( | rmm::device_buffer const & | new_null_mask, |
size_type | new_null_count, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() |
||
) |
Sets the column's null value indicator bitmask to new_null_mask
.
cudf::logic_error | if new_null_count is larger than 0 and the size of new_null_mask does not match the size of this column. |
new_null_mask | New null value indicator bitmask (lvalue overload & copied) to set the column's null value indicator mask. May be empty if new_null_count is 0. |
new_null_count | The count of null elements |
stream | The stream on which to perform the allocation and copy. Uses the default CUDF stream if none is specified. |
|
inlinenoexcept |
Returns the number of elements.
Definition at line 159 of file column.hpp.
|
inlinenoexcept |
Returns the column's logical element type.
Definition at line 152 of file column.hpp.
column_view cudf::column::view | ( | ) | const |
Creates an immutable, non-owning view of the column's data and children.