libcudf
24.04.00
|
Files | |
file | bit.hpp |
Utilities for bit and bitmask operations. | |
Functions | |
constexpr CUDF_HOST_DEVICE size_type | cudf::word_index (size_type bit_index) |
Returns the index of the word containing the specified bit. More... | |
constexpr CUDF_HOST_DEVICE size_type | cudf::intra_word_index (size_type bit_index) |
Returns the position within a word of the specified bit. More... | |
CUDF_HOST_DEVICE void | cudf::set_bit_unsafe (bitmask_type *bitmask, size_type bit_index) |
Sets the specified bit to 1 More... | |
CUDF_HOST_DEVICE void | cudf::clear_bit_unsafe (bitmask_type *bitmask, size_type bit_index) |
Sets the specified bit to 0 More... | |
CUDF_HOST_DEVICE bool | cudf::bit_is_set (bitmask_type const *bitmask, size_type bit_index) |
Indicates whether the specified bit is set to 1 More... | |
CUDF_HOST_DEVICE bool | cudf::bit_value_or (bitmask_type const *bitmask, size_type bit_index, bool default_value) |
optional-like interface to check if a specified bit of a bitmask is set. More... | |
constexpr CUDF_HOST_DEVICE bitmask_type | cudf::set_least_significant_bits (size_type n) |
Returns a bitmask word with the n least significant bits set. More... | |
constexpr CUDF_HOST_DEVICE bitmask_type | cudf::set_most_significant_bits (size_type n) |
Returns a bitmask word with the n most significant bits set. More... | |
|
inline |
|
inline |
optional-like interface to check if a specified bit of a bitmask is set.
bitmask | The bitmask containing the bit to clear |
bit_index | Index of the bit to test |
default_value | Value to return if bitmask is nullptr |
1
0
default_value
if bitmask
is nullptr
|
inline |
Sets the specified bit to 0
This function is not thread-safe, i.e., attempting to update bits within the same word concurrently from multiple threads results in undefined behavior.
bitmask | The bitmask containing the bit to clear |
bit_index | The index of the bit to clear |
|
inlineconstexpr |
|
inline |
Sets the specified bit to 1
This function is not thread-safe, i.e., attempting to update bits within the same word concurrently from multiple threads results in undefined behavior.
bitmask | The bitmask containing the bit to set |
bit_index | Index of the bit to set |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |