warpcore 0.0.1
Hashing at the Speed of Light on modern CUDA-accelerators
warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes > Class Template Reference

counting hash table More...

Public Types

using key_type = typename base_type::key_type
 
using value_type = typename base_type::value_type
 
using index_type = typename base_type::index_type
 
using status_type = typename base_type::status_type
 

Public Member Functions

__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...
 

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__ index_type cg_size () noexcept
 get cooperative group size More...
 
static constexpr __host____device__ bool is_empty_key (key_type key) noexcept
 checks if key is equal to EmptyKey More...
 
static constexpr __host____device__ bool is_tombstone_key (key_type key) noexcept
 checks if key is equal to TombstoneKey More...
 
static constexpr __host____device__ bool is_valid_key (key_type key) noexcept
 checks if key is equal to (EmptyKey||TombstoneKey) More...
 

Detailed Description

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
Keykey type (std::uint32_t or std::uint64_t)
Valuevalue type
EmptyKeykey which represents an empty slot
TombstoneKeykey which represents an erased slot
ProbingSchemeprobing scheme from warpcore::probing_schemes
TableStorageinternal storage class warpcore::storage::key_value
TempMemoryBytessize of temporary storage (typically a few kB)

Definition at line 26 of file counting_hash_table.cuh.

Member Typedef Documentation

◆ index_type

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()>
using warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::index_type = typename base_type::index_type

Definition at line 38 of file counting_hash_table.cuh.

◆ key_type

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()>
using warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::key_type = typename base_type::key_type

Definition at line 36 of file counting_hash_table.cuh.

◆ status_type

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()>
using warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::status_type = typename base_type::status_type

Definition at line 39 of file counting_hash_table.cuh.

◆ value_type

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()>
using warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::value_type = typename base_type::value_type

Definition at line 37 of file counting_hash_table.cuh.

Constructor & Destructor Documentation

◆ CountingHashTable() [1/3]

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 ( 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 
)
inlineexplicitnoexcept

constructor

Parameters
[in]min_capacityminimum number of slots in the hash table
[in]seedrandom seed
[in]max_countcount after which to stop counting new occurrences
[in]no_initwhether to initialize the table at construction or not

Definition at line 75 of file counting_hash_table.cuh.

◆ CountingHashTable() [2/3]

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

copy-constructor (shallow)

Parameters
[in]objectto be copied

Definition at line 91 of file counting_hash_table.cuh.

◆ CountingHashTable() [3/3]

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

move-constructor

Parameters
[in]objectto be moved

Definition at line 101 of file counting_hash_table.cuh.

Member Function Documentation

◆ capacity()

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__ index_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::capacity ( ) const
inlinenoexcept

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.

◆ cg_size()

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__ index_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::cg_size ( )
inlinestaticconstexprnoexcept

get cooperative group size

Returns
cooperative group size

Definition at line 63 of file counting_hash_table.cuh.

◆ empty_key()

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 >::empty_key ( )
inlinestaticconstexprnoexcept

get empty key

Returns
empty key

Definition at line 45 of file counting_hash_table.cuh.

◆ erase() [1/2]

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
StatusHandlerhandles status per key (see status_handlers)
Parameters
[in]keys_inpointer to keys to erase from the hash table
[in]num_innumber of keys to erase
[in]streamCUDA stream in which this operation is executed in
[in]probing_lengthmaximum number of probing attempts
[out]status_outstatus information (per key)

Definition at line 292 of file counting_hash_table.cuh.

◆ erase() [2/2]

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()>
__device__ status_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::erase ( key_type  key_in,
const cg::thread_block_tile< cg_size()> &  group,
index_type  probing_length = defaults::probing_length() 
)
inlinenoexcept

erases a key from the hash table

Parameters
[in]key_inkey to erase from the hash table
[in]groupcooperative group
[in]probing_lengthmaximum number of probing attempts
Returns
status (per thread)

Definition at line 274 of file counting_hash_table.cuh.

◆ for_each()

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
Functype of map i.e. CUDA device lambda
Parameters
[in]fmap to apply
[in]streamCUDA stream in which this operation is executed in
[in]sizeof shared memory to reserve for this execution

Definition at line 311 of file counting_hash_table.cuh.

◆ init() [1/2]

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]streamCUDA stream in which this operation is executed in

Definition at line 130 of file counting_hash_table.cuh.

◆ init() [2/2]

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]seedrandom seed
[in]streamCUDA stream in which this operation is executed in

Definition at line 114 of file counting_hash_table.cuh.

◆ insert() [1/2]

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
StatusHandlerhandles status per key (see status_handlers)
Parameters
[in]keys_inpointer to keys to insert into the hash table
[in]num_innumber of keys to insert
[in]streamCUDA stream in which this operation is executed in
[in]probing_lengthmaximum number of probing attempts
[out]status_outstatus information per key

Definition at line 184 of file counting_hash_table.cuh.

◆ insert() [2/2]

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()>
__device__ status_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::insert ( key_type  key_in,
const cg::thread_block_tile< cg_size()> &  group,
index_type  probing_length = defaults::probing_length() 
)
inlinenoexcept

inserts a key into the hash table

Parameters
[in]key_inkey to insert into the hash table
[in]groupcooperative group
[in]probing_lengthmaximum number of probing attempts
Returns
status (per thread)

Definition at line 142 of file counting_hash_table.cuh.

◆ is_copy()

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

indicates if this object is a shallow copy

Returns
bool

Definition at line 418 of file counting_hash_table.cuh.

◆ is_empty_key()

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

checks if key is equal to EmptyKey

Returns
bool

Definition at line 382 of file counting_hash_table.cuh.

◆ is_tombstone_key()

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

checks if key is equal to TombstoneKey

Returns
bool

Definition at line 391 of file counting_hash_table.cuh.

◆ is_valid_key()

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

checks if key is equal to (EmptyKey||TombstoneKey)

Returns
bool

Definition at line 400 of file counting_hash_table.cuh.

◆ load_factor()

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
streamCUDA stream in which this operation is executed in
Returns
load factor

Definition at line 334 of file counting_hash_table.cuh.

◆ peek_status()

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__ status_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::peek_status ( cudaStream_t  stream = 0) const
inlinenoexcept

get the status of the hash table

Parameters
streamCUDA stream in which this operation is executed in
Returns
the status

Definition at line 363 of file counting_hash_table.cuh.

◆ pop_status()

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__ status_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::pop_status ( cudaStream_t  stream = 0)
inlinenoexcept

get and reset the status of the hash table

Parameters
streamCUDA stream in which this operation is executed in
Returns
the status

Definition at line 373 of file counting_hash_table.cuh.

◆ retrieve() [1/2]

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
StatusHandlerhandles status per key (see status_handlers)
Parameters
[in]keys_inpointer to keys to retrieve from the hash table
[in]num_innumber of keys to retrieve
[out]values_outcorresponding counts of keys in key_in
[in]streamCUDA stream in which this operation is executed in
[in]probing_lengthmaximum number of probing attempts
[out]status_outstatus information (per key)

Definition at line 238 of file counting_hash_table.cuh.

◆ retrieve() [2/2]

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()>
__device__ status_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

retrieves a key from the hash table

Parameters
[in]key_inkey to retrieve from the hash table
[out]value_outcount of key_in
[in]groupcooperative group
[in]probing_lengthmaximum number of probing attempts
Returns
status (per thread)

Definition at line 204 of file counting_hash_table.cuh.

◆ retrieve_all()

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 >::retrieve_all ( key_type keys_out,
value_type values_out,
index_t num_out,
cudaStream_t  stream = 0 
) const
inlinenoexcept

retrieves all elements from the hash table

Parameters
[out]keys_outlocation to store all retrieved keys
[out]values_outlocation to store all retrieved counts
[out]num_outnumber of of key/value pairs retrieved
[in]streamCUDA stream in which this operation is executed in

Definition at line 258 of file counting_hash_table.cuh.

◆ seed()

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__ key_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::seed ( ) const
inlinenoexcept

get random seed

Returns
seed

Definition at line 409 of file counting_hash_table.cuh.

◆ size()

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__ index_type warpcore::CountingHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::size ( cudaStream_t  stream = 0) const
inlinenoexcept

number of key/value pairs stored inside the hash table

Parameters
streamCUDA 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.

◆ storage_density()

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
streamCUDA stream in which this operation is executed in
Returns
storage density

Definition at line 344 of file counting_hash_table.cuh.

◆ tombstone_key()

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

get tombstone key

Returns
tombstone key

Definition at line 54 of file counting_hash_table.cuh.


The documentation for this class was generated from the following file: