bucket list hash table More...
Public Types | |
using | handle_type = typename ValueStore::handle_type |
using | key_type = Key |
using | value_type = Value |
using | index_type = index_t |
using | status_type = Status |
Public Member Functions | |
__host__ | BucketListHashTable (const index_type key_capacity, const index_type value_capacity, const key_type seed=defaults::seed< key_type >(), const float grow_factor=1.1, const index_type min_bucket_size=1, const index_type max_bucket_size=max_bucket_size(), const index_type max_values_per_key=handle_type::max_value_count(), const bool no_init=false) noexcept |
constructor More... | |
__host____device__ | BucketListHashTable (const BucketListHashTable &o) noexcept |
copy-constructor (shallow) More... | |
__host__ | BucketListHashTable (BucketListHashTable &&o) noexcept |
move-constructor More... | |
__host__ void | init (const key_type seed, const cudaStream_t stream=0) noexcept |
(re)initialize the hash table More... | |
__host__ void | init (const cudaStream_t stream=0) noexcept |
(re)initialize the hash table More... | |
__device__ status_type | insert (const key_type key_in, const value_type &value_in, const cg::thread_block_tile< cg_size()> &group, const index_type probing_length=defaults::probing_length()) noexcept |
inserts a key/value pair into the hash table More... | |
template<class StatusHandler = defaults::status_handler_t> | |
__host__ void | insert (const key_type *const keys_in, const value_type *const values_in, const index_type num_in, const cudaStream_t stream=0, const index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *const status_out=nullptr) noexcept |
insert a set of keys into the hash table More... | |
__device__ status_type | retrieve (const key_type key_in, value_type *const values_out, index_type &num_out, const cg::thread_block_tile< cg_size()> &group, const index_type probing_length=defaults::probing_length()) const noexcept |
retrieves a key from the hash table More... | |
template<class StatusHandler = defaults::status_handler_t> | |
__host__ void | retrieve (const key_type *const keys_in, const index_type num_in, index_type *const begin_offsets_out, index_type *const end_offsets_out, value_type *const values_out, index_type &num_out, const cudaStream_t stream=0, const index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *const status_out=nullptr) const noexcept |
retrieve a set of keys from the hash table More... | |
template<class Func > | |
__device__ status_type | for_each (Func f, const key_type key_in, const cg::thread_block_tile< cg_size()> &group, const index_type probing_length=defaults::probing_length()) const noexcept |
applies a funtion over all values of a corresponding key More... | |
__host__ void | retrieve_all (key_type *const keys_out, index_type &num_keys_out, index_type *const begin_offsets_out, index_type *const end_offsets_out, value_type *const values_out, value_type &num_values_out, const cudaStream_t stream=0) const noexcept |
retrieves all elements from the hash table \info this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr ) is provided \info this method implements a multi-stage dry-run mode More... | |
__host__ void | retrieve_all_keys (key_type *const keys_out, index_type &num_out, const cudaStream_t stream=0) const noexcept |
retrieves the set of all keys stored inside the hash table More... | |
__host__ float | key_load_factor (const cudaStream_t stream=0) const noexcept |
get load factor of the key store More... | |
__host__ float | value_load_factor (const cudaStream_t stream=0) const noexcept |
get load factor of the value store More... | |
__host__ index_type | bytes_total () const noexcept |
get the the total number of bytes occupied by this data structure More... | |
__host__ index_type | bytes_keys (const cudaStream_t stream=0) const noexcept |
get the the number of bytes in this data structure occupied by keys More... | |
__host__ index_type | bytes_values (const cudaStream_t stream=0) const noexcept |
get the the number of bytes in this data structure occupied by values More... | |
__host__ index_type | bytes_payload (const cudaStream_t stream=0) const noexcept |
get the the number of bytes in this data structure occupied by actual information More... | |
__host__ float | storage_density (const cudaStream_t stream=0) const noexcept |
current storage density of the hash table More... | |
__host__ float | relative_storage_density (const cudaStream_t stream=0) const noexcept |
current relative storage density of the hash table More... | |
__host____device__ bool | is_initialized () const noexcept |
indicates if the hash table is properly initialized More... | |
__host__ status_type | peek_status (const cudaStream_t stream=0) const noexcept |
get the status of the hash table More... | |
__host__ status_type | pop_status (const cudaStream_t stream=0) noexcept |
get and reset the status of the hash table More... | |
__host__ index_type | key_capacity () const noexcept |
get the key capacity of the hash table More... | |
__host__ index_type | value_capacity () const noexcept |
get the maximum value capacity of the hash table More... | |
__host__ index_type | num_keys (const cudaStream_t stream=0) const noexcept |
number of keys stored inside the hash table More... | |
__device__ status_type | num_values (const key_type key_in, index_type &num_out, const cg::thread_block_tile< cg_size()> &group, const index_type probing_length=defaults::probing_length()) const noexcept |
get number of values to a corresponding key inside the hash table More... | |
template<class StatusHandler = defaults::status_handler_t> | |
__host__ void | num_values (const key_type *const keys_in, const index_type num_in, index_type &num_out, index_type *const num_per_key_out=nullptr, const cudaStream_t stream=0, const index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *const status_out=nullptr) const noexcept |
get number of values to a corresponding set of keys inside the hash table More... | |
__host__ index_type | num_values (const cudaStream_t stream=0) const noexcept |
get number of values inside the hash table More... | |
__host____device__ bool | is_copy () const noexcept |
indicates if this object is a shallow copy More... | |
Static Public Member Functions | |
static constexpr __host____device__ key_type | empty_key () noexcept |
get empty key More... | |
static constexpr __host____device__ key_type | tombstone_key () noexcept |
get tombstone key More... | |
static constexpr __host____device__ bool | is_valid_key (const key_type key) noexcept |
checks if key is equal to (EmptyKey||TombstoneKey) More... | |
static constexpr __host____device__ index_type | cg_size () noexcept |
get cooperative group size More... | |
static constexpr __host____device__ index_type | max_bucket_size () noexcept |
maximum bucket size More... | |
Friends | |
template<class Core , class StatusHandler > | |
GLOBALQUALIFIER friend void | kernels::retrieve (const typename Core::key_type *const, const index_type, const index_type *const, const index_type *const, typename Core::value_type *const, const Core, const index_type, typename StatusHandler::base_type *const) |
bucket list hash table
Key | key type (std::uint32_t or std::uint64_t ) |
Value | value type |
EmptyKey | key which represents an empty slot |
TombstoneKey | key which represents an erased slot |
ValueStore | storage class from warpcore::storage::multi_value |
ProbingScheme | probing scheme from warpcore::probing_schemes |
Definition at line 24 of file bucket_list_hash_table.cuh.
using warpcore::BucketListHashTable< Key, Value, EmptyKey, TombstoneKey, ValueStore, ProbingScheme >::handle_type = typename ValueStore::handle_type |
Definition at line 32 of file bucket_list_hash_table.cuh.
using warpcore::BucketListHashTable< Key, Value, EmptyKey, TombstoneKey, ValueStore, ProbingScheme >::index_type = index_t |
Definition at line 47 of file bucket_list_hash_table.cuh.
using warpcore::BucketListHashTable< Key, Value, EmptyKey, TombstoneKey, ValueStore, ProbingScheme >::key_type = Key |
Definition at line 45 of file bucket_list_hash_table.cuh.
using warpcore::BucketListHashTable< Key, Value, EmptyKey, TombstoneKey, ValueStore, ProbingScheme >::status_type = Status |
Definition at line 48 of file bucket_list_hash_table.cuh.
using warpcore::BucketListHashTable< Key, Value, EmptyKey, TombstoneKey, ValueStore, ProbingScheme >::value_type = Value |
Definition at line 46 of file bucket_list_hash_table.cuh.
|
inlineexplicitnoexcept |
constructor
[in] | key_capacity | guaranteed number of key slots in the hash table |
[in] | value_capacity | total number of value slots |
[in] | seed | random seed |
[in] | grow_factor | bucket grow factor for warpcore::storage::multi_value::BucketListStore |
[in] | min_bucket_size | initial size of value buckets for warpcore::storage::multi_value::BucketListStore |
[in] | max_bucket_size | bucket size of warpcore::storage::multi_value::BucketListStore after which no more growth occurs |
[in] | max_values_per_key | maximum number of values to store per key |
Definition at line 105 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
copy-constructor (shallow)
[in] | object | to be copied |
Definition at line 128 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
move-constructor
[in] | object | to be moved |
Definition at line 139 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the the number of bytes in this data structure occupied by keys
stream | CUDA stream in which this operation is executed in |
Definition at line 641 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the the number of bytes in this data structure occupied by actual information
stream | CUDA stream in which this operation is executed in |
Definition at line 661 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the the total number of bytes occupied by this data structure
Definition at line 631 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the the number of bytes in this data structure occupied by values
stream | CUDA stream in which this operation is executed in |
Definition at line 651 of file bucket_list_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
get cooperative group size
Definition at line 81 of file bucket_list_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
applies a funtion over all values of a corresponding key
Func | type of map i.e. CUDA device lambda |
[in] | f | map to apply |
[in] | key_in | key to retrieve |
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 505 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
(re)initialize the hash table
stream | CUDA stream in which this operation is executed |
Definition at line 172 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
(re)initialize the hash table
seed | random seed |
stream | CUDA stream in which this operation is executed |
Definition at line 153 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
insert a set of keys into the hash table
StatusHandler | handles returned status per key (see status_handlers ) |
[in] | keys_in | pointer to keys to insert into the hash table |
[in] | values_in | corresponds values to keys_in |
[in] | num_in | number of keys to insert |
[in] | stream | CUDA stream in which this operation is executed in |
[in] | probing_length | maximum number of probing attempts |
[out] | status_out | status information per key |
Definition at line 236 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
inserts a key/value pair into the hash table
[in] | key_in | key to insert into the hash table |
[in] | value_in | value that corresponds to key_in |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
Definition at line 185 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
indicates if this object is a shallow copy
bool
Definition at line 844 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
indicates if the hash table is properly initialized
true
iff the hash table is properly initialized Definition at line 695 of file bucket_list_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if key
is equal to (EmptyKey||TombstoneKey)
bool
Definition at line 72 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the key capacity of the hash table
Definition at line 724 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get load factor of the key store
stream | CUDA stream in which this operation is executed in |
Definition at line 612 of file bucket_list_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
number of keys stored inside the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 743 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get number of values inside the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 818 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get number of values to a corresponding set of keys inside the hash table
[in] | keys_in | keys to probe |
[in] | num_in | input size |
[out] | num_out | total number of values in this query |
[out] | num_per_key_out | number of values per key |
[in] | probing_length | maximum number of probing attempts |
[in] | stream | CUDA stream in which this operation is executed in |
[out] | status_out | status information (per key) |
Definition at line 783 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get number of values to a corresponding key inside the hash table
[in] | key_in | key to probe |
[out] | num_out | number of values |
[in] | group | cooperative group this operation is executed in |
[in] | probing_length | maximum number of probing attempts |
Definition at line 756 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get the status of the hash table
stream | CUDA stream in which this operation is executed in |
Definition at line 705 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get and reset the status of the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 715 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
current relative storage density of the hash table
stream | CUDA stream in which this operation is executed in |
Definition at line 681 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
retrieve a set of keys from the hash table
nullptr
) is provided end_offsets_out
can be begin_offsets_out+1
StatusHandler | handles returned status per key (see status_handlers ) |
[in] | keys_in | pointer to keys to retrieve from the hash table |
[in] | num_in | number of keys to retrieve |
[out] | begin_offsets_out | |
[out] | end_offsets_out | |
[out] | values_out | retrieved values of keys in key_in |
[out] | num_out | total number of values retrieved by this operation |
[in] | stream | CUDA stream in which this operation is executed in |
[in] | probing_length | maximum number of probing attempts |
[out] | status_out | status information (per key) |
Definition at line 400 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
retrieves a key from the hash table
[in] | key_in | key to retrieve from the hash table |
[out] | values_out | pointer to storage fo the retrieved values |
[out] | num_out | number of values retrieved |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
Definition at line 350 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
retrieves all elements from the hash table \info this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr
) is provided \info this method implements a multi-stage dry-run mode
[out] | keys_out | pointer to the set of unique keys |
[out] | num_keys_out | number of unique keys |
[out] | begin_offsets_out | begin of value range for a corresponding key in values_out |
[out] | end_offsets_out | end of value range for a corresponding key in values_out |
[out] | values_out | array which holds all retrieved values |
[out] | num_values_out | total number of values retrieved by this operation |
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 539 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
retrieves the set of all keys stored inside the hash table
[out] | keys_out | pointer to the retrieved keys |
[out] | num_out | number of retrieved keys |
[in] | stream | CUDA stream in which this operation is executed in |
keys_out==nullptr
then only num_out
will be computed Definition at line 575 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
current storage density of the hash table
stream | CUDA stream in which this operation is executed in |
Definition at line 671 of file bucket_list_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
get the maximum value capacity of the hash table
Definition at line 733 of file bucket_list_hash_table.cuh.
|
inlinenoexcept |
get load factor of the value store
stream | CUDA stream in which this operation is executed in |
Definition at line 622 of file bucket_list_hash_table.cuh.
|
friend |