A type-erased wrapper around cuco's roaring bitmap supporting both 32-bit and 64-bit keys.
More...
#include <cudf/utilities/roaring_bitmap.hpp>
A type-erased wrapper around cuco's roaring bitmap supporting both 32-bit and 64-bit keys.
This class holds a span of serialized roaring bitmap data (specified 32-bit or 64-bit) on the host and lazily materializes the corresponding underlying cuco roaring bitmap when materialize() is called or implicitly when contains_async() is first called.
Example usage (64-bit version):
bitmap.materialize(stream);
auto result = bitmap.contains_async(keys_column, stream, mr);
A type-erased wrapper around cuco's roaring bitmap supporting both 32-bit and 64-bit keys.
@ BITS_64
64-bit roaring bitmap (keys are uint64)
Definition at line 57 of file roaring_bitmap.hpp.
◆ roaring_bitmap() [1/2]
| cudf::roaring_bitmap::roaring_bitmap |
( |
roaring_bitmap_type |
type, |
|
|
std::span< cuda::std::byte const > |
serialized_bitmap_data |
|
) |
| |
|
explicit |
Constructs a roaring_bitmap from serialized bitmap data (payload)
The serialized bitmap data must remain valid until the underlying cuco roaring bitmap is materialized via materialize().
- Parameters
-
| type | The bitmap key type (BITS_32 or BITS_64) |
| serialized_bitmap_data | Host span of bytes containing a roaring bitmap serialized in portable format |
- Exceptions
-
| std::invalid_argument | if the serialized bitmap data is empty |
◆ roaring_bitmap() [2/2]
Move constructor for the roaring bitmap class.
- Parameters
-
| other | Roaring bitmap to move from |
◆ contains_async() [1/2]
Asynchronously queries the bitmap for membership of each key in the input column.
The input column must have dtype UINT32 (for BITS_32) or UINT64 (for BITS_64).
- Parameters
-
| keys | Key column to query |
| stream | CUDA stream used for device memory operations and kernel launches |
| mr | Device memory resource for the output column allocation |
- Returns
- A BOOL8 column indicating positions of the present keys
- Exceptions
-
| std::invalid_argument | if the key column dtype is invalid |
◆ contains_async() [2/2]
Asynchronously queries the bitmap for membership of each key in a column and stores the result in the output column.
The input column must have dtype UINT32 (for BITS_32) or UINT64 (for BITS_64). The output column must have BOOL8 dtype.
- Parameters
-
| keys | Key column to query |
| output | Output column to store the result |
| stream | CUDA stream used for device memory operations and kernel launches |
- Exceptions
-
| std::invalid_argument | if the key or output column dtypes are invalid |
◆ empty()
| bool cudf::roaring_bitmap::empty |
( |
| ) |
const |
Checks whether the bitmap contains no keys.
- Returns
- Whether the roaring bitmap contains no keys
◆ materialize()
Materialize the underlying cuco roaring bitmap.
The serialized bitmap data span is cleared after this call.
- Parameters
-
| stream | CUDA stream used for device memory operations and kernel launches |
◆ operator=()
Move assignment operator for the roaring bitmap class.
- Parameters
-
| other | Roaring bitmap to move from |
- Returns
- Reference to the moved-from roaring bitmap
◆ size()
| cuda::std::size_t cudf::roaring_bitmap::size |
( |
| ) |
const |
Returns the number of keys stored in the bitmap.
- Returns
- Number of keys stored in the bitmap
◆ size_bytes()
| cuda::std::size_t cudf::roaring_bitmap::size_bytes |
( |
| ) |
const |
Returns the size of the serialized bitmap storage in bytes.
- Returns
- Size of the serialized bitmap storage in bytes
◆ type()
Returns the roaring bitmap type.
- Returns
- Roaring bitmap type
The documentation for this class was generated from the following file: