null_mask#

pylibcudf.null_mask.bitmask_allocation_size_bytes(size_type number_of_bits) size_t#

Computes the required bytes necessary to represent the specified number of bits with a 64B padding boundary.

For details, see bitmask_allocation_size_bytes().

Parameters:
number_of_bitssize_type

The number of bits that need to be represented

Returns:
size_t

The necessary number of bytes

pylibcudf.null_mask.bitmask_and(list columns, Stream stream=None, DeviceMemoryResource mr=None) tuple#

Performs bitwise AND of the bitmasks of a list of columns.

For details, see bitmask_and().

Parameters:
columnslist

The list of columns

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource for allocations.

Returns:
tuple[DeviceBuffer, size_type]

A tuple of the resulting mask and count of unset bits

pylibcudf.null_mask.bitmask_or(list columns, Stream stream=None, DeviceMemoryResource mr=None) tuple#

Performs bitwise OR of the bitmasks of a list of columns.

For details, see bitmask_or().

Parameters:
columnslist

The list of columns

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource for allocations.

Returns:
tuple[DeviceBuffer, size_type]

A tuple of the resulting mask and count of unset bits

pylibcudf.null_mask.copy_bitmask(Column col, Stream stream=None, DeviceMemoryResource mr=None) rmm.DeviceBuffer#

Copies col’s bitmask into a DeviceBuffer.

For details, see copy_bitmask().

Parameters:
colColumn

Column whose bitmask needs to be copied

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource for allocations.

Returns:
rmm.DeviceBuffer

A DeviceBuffer containing col’s bitmask, or an empty DeviceBuffer if col is not nullable

pylibcudf.null_mask.create_null_mask(size_type size, mask_state state=mask_state.UNINITIALIZED, Stream stream=None, DeviceMemoryResource mr=None) rmm.DeviceBuffer#

Creates a DeviceBuffer for use as a null value indicator bitmask of a Column.

For details, see create_null_mask().

Parameters:
sizesize_type

The number of elements to be represented by the mask

statemask_state, optional

The desired state of the mask. Can be one of { MaskState.UNALLOCATED, MaskState.UNINITIALIZED, MaskState.ALL_VALID, MaskState.ALL_NULL } (default MaskState.UNINITIALIZED)

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource for allocations.

Returns:
rmm.DeviceBuffer

A DeviceBuffer for use as a null bitmask satisfying the desired size and state

pylibcudf.null_mask.null_count(bitmask, size_type start, size_type stop, Stream stream=None) size_type#

Given a validity bitmask, counts the number of null elements.

For details, see null_count().

Parameters:
bitmaskSpan-like object

Object with ptr and size attributes (e.g., gpumemoryview, Buffer, DeviceBuffer).

startint

Index of the first bit to count (inclusive).

stopint

Index of the last bit to count (exclusive).

streamStream | None

CUDA stream on which to perform the operation.

Returns:
int

The number of null elements in the specified range.