multi-value hash table More...
Public Types | |
using | key_type = Key |
using | value_type = Value |
using | bucket_type = typename TableStorage::value_type |
using | index_type = index_t |
using | status_type = Status |
using | probing_scheme_type = ProbingScheme |
Public Member Functions | |
__host__ | MultiBucketHashTable (const index_type min_capacity, const key_type seed=defaults::seed< key_type >(), const index_type max_values_per_key=std::numeric_limits< index_type >::max(), const bool no_init=false) noexcept |
constructor More... | |
__host____device__ | MultiBucketHashTable (const MultiBucketHashTable &o) noexcept |
copy-constructor (shallow) More... | |
__host__ | MultiBucketHashTable (MultiBucketHashTable &&o) noexcept |
move-constructor More... | |
__host__ | ~MultiBucketHashTable () noexcept |
destructor 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 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 all values to a corresponding key 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... | |
__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 More... | |
__host__ void | retrieve_all_keys (key_type *const keys_out, index_type &num_out, const cudaStream_t stream=0) const noexcept |
retrieve all unqiue keys \info this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr ) is provided More... | |
template<class Func > | |
__device__ status_type | for_each (Func f, const key_type key_in, index_type &num_values_out, 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 specified key More... | |
template<class Func > | |
__host__ void | for_each_bucket (Func f, const cudaStream_t stream=0, const index_type smem_bytes=0) const noexcept |
applies a funtion over all key bucket pairs inside the table More... | |
template<class Func > | |
__host__ void | for_each_value (Func f, const cudaStream_t stream=0, const index_type smem_bytes=0) const noexcept |
applies a funtion over all key value pairs inside the table More... | |
template<class Func , class StatusHandler = defaults::status_handler_t> | |
__host__ void | for_each (Func f, const key_type *const keys_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, const index_type smem_bytes=0) const noexcept |
applies a funtion over all key value pairs More... | |
__host__ index_type | num_keys (const cudaStream_t stream=0) const noexcept |
number of unique keys inside the table More... | |
__host__ index_type | num_occupied (const cudaStream_t stream=0) const noexcept |
number of occupied slots in 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 |
total number of values inside the 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 |
number of values associated to a set of keys \info this function returns only num_out if num_per_key_out==nullptr More... | |
__host__ index_type | num_values (const cudaStream_t stream=0) const noexcept |
number of values stored inside the hash table \info alias for size() More... | |
__host__ index_type | size (const cudaStream_t stream=0) const noexcept |
number of values stored inside the hash table More... | |
__host__ float | key_load_factor (const cudaStream_t stream=0) const noexcept |
current load factor of the hash table More... | |
__host__ float | value_load_factor (const cudaStream_t stream=0) const noexcept |
current load factor of the hash table 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__ index_type | capacity () const noexcept |
get the key capacity of the hash table More... | |
__host____device__ index_type | value_capacity () const noexcept |
get the maximum value capacity of the hash table More... | |
__host__ index_type | bytes_total () const noexcept |
get the total number of bytes occupied by this data structure 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____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__ value_type | empty_value () noexcept |
get empty value More... | |
static constexpr __host____device__ index_type | cg_size () noexcept |
get cooperative group size More... | |
static constexpr __host____device__ index_type | bucket_size () noexcept |
get bucket size More... | |
static constexpr __host____device__ bool | is_empty_key (const key_type key) noexcept |
checks if key is equal to EmptyKey More... | |
static constexpr __host____device__ bool | is_tombstone_key (const key_type key) noexcept |
checks if key is equal to TombstoneKey More... | |
static constexpr __host____device__ bool | is_valid_key (const key_type key) noexcept |
checks if key is not equal to (EmptyKey||TombstoneKey) More... | |
static constexpr __host____device__ bool | is_empty_value (const value_type value) noexcept |
checks if value is equal to EmptyValue More... | |
static constexpr __host____device__ bool | is_valid_value (const value_type value) noexcept |
checks if value is equal not to EmptyValue More... | |
Friends | |
template<class Core > | |
GLOBALQUALIFIER friend void | kernels::size (index_type *const, const Core) |
template<class Core > | |
GLOBALQUALIFIER friend void | kernels::num_values (index_type *const, const Core) |
template<class Func , class Core > | |
GLOBALQUALIFIER friend void | kernels::for_each (Func, const Core) |
template<class Func , class Core > | |
GLOBALQUALIFIER friend void | kernels::for_each_unique_key (Func, const Core) |
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) |
multi-value 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 |
ProbingScheme | probing scheme from warpcore::probing_schemes |
TableStorage | memory layout from warpcore::storage::key_value |
TempMemoryBytes | size of temporary storage (typically a few kB) |
Definition at line 102 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::bucket_type = typename TableStorage::value_type |
Definition at line 145 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::index_type = index_t |
Definition at line 146 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::key_type = Key |
Definition at line 143 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::probing_scheme_type = ProbingScheme |
Definition at line 148 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::status_type = Status |
Definition at line 147 of file multi_bucket_hash_table.cuh.
using warpcore::MultiBucketHashTable< Key, Value, EmptyKey, TombstoneKey, EmptyValue, ProbingScheme, TableStorage, TempMemoryBytes >::value_type = Value |
Definition at line 144 of file multi_bucket_hash_table.cuh.
|
inlineexplicitnoexcept |
constructor
[in] | min_capacity | minimum number of slots in the hash table |
[in] | seed | random seed |
[in] | max_values_per_key | maximum number of values to store per key |
[in] | no_init | whether to initialize the table at construction or not |
Definition at line 203 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
copy-constructor (shallow)
[in] | object | to be copied |
Definition at line 232 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
move-constructor
[in] | object | to be moved |
Definition at line 248 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
destructor
Definition at line 266 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
get the total number of bytes occupied by this data structure
Definition at line 1155 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
get the key capacity of the hash table
Definition at line 1137 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
get cooperative group size
Definition at line 182 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
applies a funtion over all key value pairs
Func | type of map i.e. CUDA device lambda |
StatusHandler | handles returned status per key (see status_handlers ) |
[in] | f | map to apply |
[in] | keys_in | keys to consider |
[in] | num_in | number of keys |
[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) |
[in] | size | of dynamic shared memory to reserve for this execution |
Definition at line 926 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
applies a funtion over all values of a specified key
Func | type of map i.e. CUDA device lambda |
[in] | f | map to apply |
[in] | key_in | key to consider |
[out] | num_values_out | number of values associated to key_in |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
Definition at line 792 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
applies a funtion over all key bucket pairs inside the table
Func | type of map i.e. CUDA device lambda |
[in] | f | map to apply |
[in] | stream | CUDA stream in which this operation is executed in |
[in] | size | of dynamic shared memory to reserve for this execution |
Definition at line 870 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
applies a funtion over all key value pairs inside the table
Func | type of map i.e. CUDA device lambda |
[in] | f | map to apply |
[in] | stream | CUDA stream in which this operation is executed in |
[in] | size | of dynamic shared memory to reserve for this execution |
Definition at line 890 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
(re)initialize the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 281 of file multi_bucket_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 532 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
inserts a key 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 378 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
indicates if this object is a shallow copy
bool
Definition at line 1266 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if key
is equal to EmptyKey
bool
Definition at line 1221 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if value
is equal to EmptyValue
bool
Definition at line 1248 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
indicates if the hash table is properly initialized
true
iff the hash table is properly initialized Definition at line 1164 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if key
is equal to TombstoneKey
bool
Definition at line 1230 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if key
is not equal to (EmptyKey||TombstoneKey)
bool
Definition at line 1239 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
checks if value
is equal not to EmptyValue
bool
Definition at line 1257 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
current load factor of the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1089 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
number of unique keys inside the table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 951 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
number of occupied slots in the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 967 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
number of values stored inside the hash table \info alias for size()
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1049 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
number of values associated to a set of keys \info this function returns only num_out
if num_per_key_out==nullptr
StatusHandler | handles returned status per key (see status_handlers ) |
[in] | keys_in | keys to consider |
[in] | num_in | number of keys |
[out] | num_out | total number of values |
[out] | num_per_key_out | number of values per key |
[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 1015 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
total number of values inside the table
[in] | key_in | key to be probed |
[out] | num_out | number of values associated to key_in* |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
Definition at line 986 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
get the status of the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1174 of file multi_bucket_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 1198 of file multi_bucket_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 1123 of file multi_bucket_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 | 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] | 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 602 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
retrieves all values to a corresponding key
[in] | key_in | key to retrieve from the hash table |
[out] | values_out | values for key_in |
[out] | num_out | number of retrieved values |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
Definition at line 560 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
retrieves all elements from the hash table
nullptr
) is provided [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 709 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
retrieve all unqiue keys \info this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr
) is provided
[out] | keys_out | retrieved unqiue keys |
[out] | num_out | numof unique keys |
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 747 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
number of values stored inside the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1059 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
current storage density of the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1109 of file multi_bucket_hash_table.cuh.
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
get the maximum value capacity of the hash table
Definition at line 1146 of file multi_bucket_hash_table.cuh.
|
inlinenoexcept |
current load factor of the hash table
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 1099 of file multi_bucket_hash_table.cuh.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |