|
__host__ | CountingHashTable (index_type min_capacity, key_type seed=defaults::seed< key_type >(), value_type max_count=std::numeric_limits< value_type >::max(), bool no_init=false) noexcept |
| constructor More...
|
|
__host____device__ | CountingHashTable (const CountingHashTable &o) noexcept |
| copy-constructor (shallow) More...
|
|
__host__ | CountingHashTable (CountingHashTable &&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 (key_type key_in, const cg::thread_block_tile< cg_size()> &group, 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 *keys_in, index_type num_in, cudaStream_t stream=0, index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *status_out=nullptr) noexcept |
| insert a set of keys into the hash table More...
|
|
__device__ status_type | retrieve (key_type key_in, value_type &value_out, const cg::thread_block_tile< cg_size()> &group, 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 *keys_in, index_type num_in, value_type *values_out, cudaStream_t stream=0, index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *status_out=nullptr) const noexcept |
| retrieve a set of keys from the hash table More...
|
|
__host__ void | retrieve_all (key_type *keys_out, value_type *values_out, index_t &num_out, cudaStream_t stream=0) const noexcept |
| retrieves all elements from the hash table More...
|
|
__device__ status_type | erase (key_type key_in, const cg::thread_block_tile< cg_size()> &group, index_type probing_length=defaults::probing_length()) noexcept |
| erases a key from the hash table More...
|
|
template<class StatusHandler = defaults::status_handler_t> |
__host__ void | erase (key_type *keys_in, index_type num_in, cudaStream_t stream=0, index_type probing_length=defaults::probing_length(), typename StatusHandler::base_type *status_out=nullptr) noexcept |
| erases a set of keys from the hash table More...
|
|
template<class Func > |
__host__ void | for_each (Func f, cudaStream_t stream=0, index_type smem_bytes=0) const noexcept |
| applies a funtion on all key value pairs inside the table More...
|
|
__host__ index_type | size (cudaStream_t stream=0) const noexcept |
| number of key/value pairs stored inside the hash table More...
|
|
__host__ float | load_factor (cudaStream_t stream=0) const noexcept |
| current load factor of the hash table More...
|
|
__host__ float | storage_density (cudaStream_t stream=0) const noexcept |
| current storage density of the hash table More...
|
|
__host____device__ index_type | capacity () const noexcept |
| get the capacity of the hash table More...
|
|
__host__ status_type | peek_status (cudaStream_t stream=0) const noexcept |
| get the status of the hash table More...
|
|
__host__ status_type | pop_status (cudaStream_t stream=0) noexcept |
| get and reset the status of the hash table More...
|
|
__host____device__ key_type | seed () const noexcept |
| get random seed More...
|
|
__host____device__ bool | is_copy () const noexcept |
| indicates if this object is a shallow copy More...
|
|
template<class Key, class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
class warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >
counting hash table
- Template Parameters
-
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 | internal storage class warpcore::storage::key_value |
TempMemoryBytes | size of temporary storage (typically a few kB) |
Definition at line 26 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
constructor
- Parameters
-
[in] | min_capacity | minimum number of slots in the hash table |
[in] | seed | random seed |
[in] | max_count | count after which to stop counting new occurrences |
[in] | no_init | whether to initialize the table at construction or not |
Definition at line 75 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::CountingHashTable |
( |
const CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes > & |
o | ) |
|
|
inlinenoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::CountingHashTable |
( |
CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes > && |
o | ) |
|
|
inlinenoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
get the capacity of the hash table
- Returns
- number of slots in the hash table
Definition at line 353 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
|
inlinestaticconstexprnoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
|
inlinestaticconstexprnoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class StatusHandler = defaults::status_handler_t>
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::erase |
( |
key_type * |
keys_in, |
|
|
index_type |
num_in, |
|
|
cudaStream_t |
stream = 0 , |
|
|
index_type |
probing_length = defaults::probing_length() , |
|
|
typename StatusHandler::base_type * |
status_out = nullptr |
|
) |
| |
|
inlinenoexcept |
erases a set of keys from the hash table
- Template Parameters
-
- Parameters
-
[in] | keys_in | pointer to keys to erase from the hash table |
[in] | num_in | number of keys to erase |
[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 292 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
erases a key from the hash table
- Parameters
-
[in] | key_in | key to erase from the hash table |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
- Returns
- status (per thread)
Definition at line 274 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func >
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::for_each |
( |
Func |
f, |
|
|
cudaStream_t |
stream = 0 , |
|
|
index_type |
smem_bytes = 0 |
|
) |
| const |
|
inlinenoexcept |
applies a funtion on all key value pairs inside the table
- Template Parameters
-
Func | type of map i.e. CUDA device lambda |
- Parameters
-
[in] | f | map to apply |
[in] | stream | CUDA stream in which this operation is executed in |
[in] | size | of shared memory to reserve for this execution |
Definition at line 311 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::init |
( |
const cudaStream_t |
stream = 0 | ) |
|
|
inlinenoexcept |
(re)initialize the hash table
- Parameters
-
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 130 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::init |
( |
const key_type |
seed, |
|
|
const cudaStream_t |
stream = 0 |
|
) |
| |
|
inlinenoexcept |
(re)initialize the hash table
- Parameters
-
[in] | seed | random seed |
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 114 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class StatusHandler = defaults::status_handler_t>
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::insert |
( |
const key_type * |
keys_in, |
|
|
index_type |
num_in, |
|
|
cudaStream_t |
stream = 0 , |
|
|
index_type |
probing_length = defaults::probing_length() , |
|
|
typename StatusHandler::base_type * |
status_out = nullptr |
|
) |
| |
|
inlinenoexcept |
insert a set of keys into the hash table
- Template Parameters
-
- Parameters
-
[in] | keys_in | pointer to keys to insert into the hash table |
[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 184 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
inserts a key into the hash table
- Parameters
-
[in] | key_in | key to insert into the hash table |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
- Returns
- status (per thread)
Definition at line 142 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ bool warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_copy |
( |
| ) |
const |
|
inlinenoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_empty_key |
( |
key_type |
key | ) |
|
|
inlinestaticconstexprnoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_tombstone_key |
( |
key_type |
key | ) |
|
|
inlinestaticconstexprnoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_valid_key |
( |
key_type |
key | ) |
|
|
inlinestaticconstexprnoexcept |
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ float warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::load_factor |
( |
cudaStream_t |
stream = 0 | ) |
const |
|
inlinenoexcept |
current load factor of the hash table
- Parameters
-
stream | CUDA stream in which this operation is executed in |
- Returns
- load factor
Definition at line 334 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
get the status of the hash table
- Parameters
-
stream | CUDA stream in which this operation is executed in |
- Returns
- the status
Definition at line 363 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
get and reset the status of the hash table
- Parameters
-
stream | CUDA stream in which this operation is executed in |
- Returns
- the status
Definition at line 373 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class StatusHandler = defaults::status_handler_t>
__host__ void warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::retrieve |
( |
const key_type * |
keys_in, |
|
|
index_type |
num_in, |
|
|
value_type * |
values_out, |
|
|
cudaStream_t |
stream = 0 , |
|
|
index_type |
probing_length = defaults::probing_length() , |
|
|
typename StatusHandler::base_type * |
status_out = nullptr |
|
) |
| const |
|
inlinenoexcept |
retrieve a set of keys from the hash table
- Template Parameters
-
- Parameters
-
[in] | keys_in | pointer to keys to retrieve from the hash table |
[in] | num_in | number of keys to retrieve |
[out] | values_out | corresponding counts of keys in key_in |
[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 238 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
retrieves a key from the hash table
- Parameters
-
[in] | key_in | key to retrieve from the hash table |
[out] | value_out | count of key_in |
[in] | group | cooperative group |
[in] | probing_length | maximum number of probing attempts |
- Returns
- status (per thread)
Definition at line 204 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
retrieves all elements from the hash table
- Parameters
-
[out] | keys_out | location to store all retrieved keys |
[out] | values_out | location to store all retrieved counts |
[out] | num_out | number of of key/value pairs retrieved |
[in] | stream | CUDA stream in which this operation is executed in |
Definition at line 258 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
number of key/value pairs stored inside the hash table
- Parameters
-
stream | CUDA stream in which this operation is executed in |
- Returns
- the number of key/value pairs inside the hash table
Definition at line 324 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ float warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::storage_density |
( |
cudaStream_t |
stream = 0 | ) |
const |
|
inlinenoexcept |
current storage density of the hash table
- Parameters
-
stream | CUDA stream in which this operation is executed in |
- Returns
- storage density
Definition at line 344 of file counting_hash_table.cuh.
template<class Key , class Value = index_t, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 4>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ key_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::tombstone_key |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |