Namespaces | Functions
bit.hpp File Reference

Utilities for bit and bitmask operations. More...

#include <cassert>
#include <cuda/std/climits>
#include <cudf/types.hpp>

Go to the source code of this file.

Namespaces

 cudf
 cuDF interfaces
 

Functions

template<typename T >
constexpr CUDF_HOST_DEVICE std::size_t cudf::detail::size_in_bits ()
 Returns the number of bits the given type can hold. More...
 
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...
 

Detailed Description

Utilities for bit and bitmask operations.

Definition in file bit.hpp.

Function Documentation

◆ size_in_bits()

template<typename T >
constexpr CUDF_HOST_DEVICE std::size_t cudf::detail::size_in_bits ( )
inlineconstexpr

Returns the number of bits the given type can hold.

Template Parameters
TThe type to query
Returns
sizeof(T) in bits

Definition at line 53 of file bit.hpp.