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

multi-value hash table More...

Public Types

using key_type = Key
 
using value_type = Value
 
using index_type = index_t
 
using status_type = Status
 
using probing_scheme_type = ProbingScheme
 

Public Member Functions

__host__ MultiValueHashTable (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__ MultiValueHashTable (const MultiValueHashTable &o) noexcept
 copy-constructor (shallow) More...
 
__host__ MultiValueHashTable (MultiValueHashTable &&o) noexcept
 move-constructor More...
 
__host__ ~MultiValueHashTable () 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 (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...
 
__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 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____device__ index_type capacity () const noexcept
 get the capacity 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____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 (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 equal to (EmptyKey||TombstoneKey) More...
 

Friends

template<class Core >
GLOBALQUALIFIER friend void kernels::size (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)
 

Detailed Description

template<class Key, class Value, Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
class warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >

multi-value 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
TableStoragememory layout from warpcore::storage::key_value
TempMemoryBytessize of temporary storage (typically a few kB)

Definition at line 26 of file multi_value_hash_table.cuh.

Member Typedef Documentation

◆ index_type

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
using warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::index_type = index_t

Definition at line 65 of file multi_value_hash_table.cuh.

◆ key_type

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
using warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::key_type = Key

Definition at line 63 of file multi_value_hash_table.cuh.

◆ probing_scheme_type

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
using warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::probing_scheme_type = ProbingScheme

Definition at line 67 of file multi_value_hash_table.cuh.

◆ status_type

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
using warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::status_type = Status

Definition at line 66 of file multi_value_hash_table.cuh.

◆ value_type

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
using warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::value_type = Value

Definition at line 64 of file multi_value_hash_table.cuh.

Constructor & Destructor Documentation

◆ MultiValueHashTable() [1/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::MultiValueHashTable ( 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 
)
inlineexplicitnoexcept

constructor

Parameters
[in]min_capacityminimum number of slots in the hash table
[in]seedrandom seed
[in]max_values_per_keymaximum number of values to store per key
[in]no_initwhether to initialize the table at construction or not

Definition at line 103 of file multi_value_hash_table.cuh.

◆ MultiValueHashTable() [2/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::MultiValueHashTable ( const MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes > &  o)
inlinenoexcept

copy-constructor (shallow)

Parameters
[in]objectto be copied

Definition at line 130 of file multi_value_hash_table.cuh.

◆ MultiValueHashTable() [3/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::MultiValueHashTable ( MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes > &&  o)
inlinenoexcept

move-constructor

Parameters
[in]objectto be moved

Definition at line 145 of file multi_value_hash_table.cuh.

◆ ~MultiValueHashTable()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::~MultiValueHashTable ( )
inlinenoexcept

destructor

Definition at line 162 of file multi_value_hash_table.cuh.

Member Function Documentation

◆ capacity()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ index_type warpcore::MultiValueHashTable< 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 865 of file multi_value_hash_table.cuh.

◆ cg_size()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ index_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::cg_size ( )
inlinestaticconstexprnoexcept

get cooperative group size

Returns
cooperative group size

Definition at line 91 of file multi_value_hash_table.cuh.

◆ empty_key()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ key_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::empty_key ( )
inlinestaticconstexprnoexcept

get empty key

Returns
empty key

Definition at line 73 of file multi_value_hash_table.cuh.

◆ for_each() [1/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func >
__host__ void warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::for_each ( Func  f,
const cudaStream_t  stream = 0,
const index_type  smem_bytes = 0 
) const
inlinenoexcept

applies a funtion over 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 dynamic shared memory to reserve for this execution

Definition at line 671 of file multi_value_hash_table.cuh.

◆ for_each() [2/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func , class StatusHandler = defaults::status_handler_t>
__host__ void warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

applies a funtion over all key value pairs

Template Parameters
Functype of map i.e. CUDA device lambda
StatusHandlerhandles returned status per key (see status_handlers)
Parameters
[in]fmap to apply
[in]keys_inkeys to consider
[in]num_innumber of keys
[in]streamCUDA stream in which this operation is executed in
[in]probing_lengthmaximum number of probing attempts
[out]status_outstatus information (per key)
[in]sizeof dynamic shared memory to reserve for this execution

Definition at line 696 of file multi_value_hash_table.cuh.

◆ for_each() [3/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func >
__device__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

applies a funtion over all values of a specified key

Template Parameters
Functype of map i.e. CUDA device lambda
Parameters
[in]fmap to apply
[in]key_inkey to consider
[out]num_values_outnumber of values associated to key_in
[in]groupcooperative group
[in]probing_lengthmaximum number of probing attempts
Returns
status (per thread)

Definition at line 607 of file multi_value_hash_table.cuh.

◆ init()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ void warpcore::MultiValueHashTable< 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 176 of file multi_value_hash_table.cuh.

◆ insert() [1/2]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, 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::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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 
)
inlinenoexcept

insert a set of keys into the hash table

Template Parameters
StatusHandlerhandles returned status per key (see status_handlers)
Parameters
[in]keys_inpointer to keys to insert into the hash table
[in]values_incorresponds values to keys_in
[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 302 of file multi_value_hash_table.cuh.

◆ insert() [2/2]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__device__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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() 
)
inlinenoexcept

inserts a key into the hash table

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

Definition at line 201 of file multi_value_hash_table.cuh.

◆ is_copy()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ bool warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_copy ( ) const
inlinenoexcept

indicates if this object is a shallow copy

Returns
bool

Definition at line 958 of file multi_value_hash_table.cuh.

◆ is_empty_key()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_empty_key ( const key_type  key)
inlinestaticconstexprnoexcept

checks if key is equal to EmptyKey

Returns
bool

Definition at line 931 of file multi_value_hash_table.cuh.

◆ is_initialized()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host____device__ bool warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_initialized ( ) const
inlinenoexcept

indicates if the hash table is properly initialized

Returns
true iff the hash table is properly initialized

Definition at line 874 of file multi_value_hash_table.cuh.

◆ is_tombstone_key()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_tombstone_key ( const key_type  key)
inlinestaticconstexprnoexcept

checks if key is equal to TombstoneKey

Returns
bool

Definition at line 940 of file multi_value_hash_table.cuh.

◆ is_valid_key()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ bool warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::is_valid_key ( const key_type  key)
inlinestaticconstexprnoexcept

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

Returns
bool

Definition at line 949 of file multi_value_hash_table.cuh.

◆ load_factor()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ float warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::load_factor ( const cudaStream_t  stream = 0) const
inlinenoexcept

current load factor of the hash table

Parameters
[in]streamCUDA stream in which this operation is executed in
Returns
load factor

Definition at line 843 of file multi_value_hash_table.cuh.

◆ num_keys()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ index_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::num_keys ( const cudaStream_t  stream = 0) const
inlinenoexcept

number of unique keys inside the table

Parameters
[in]streamCUDA stream in which this operation is executed in
Returns
number of unique keys

Definition at line 721 of file multi_value_hash_table.cuh.

◆ num_values() [1/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ index_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::num_values ( const cudaStream_t  stream = 0) const
inlinenoexcept

number of values stored inside the hash table \info alias for size()

Parameters
[in]streamCUDA stream in which this operation is executed in
Returns
the number of values

Definition at line 803 of file multi_value_hash_table.cuh.

◆ num_values() [2/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, 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::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

number of values associated to a set of keys \info this function returns only num_out if num_per_key_out==nullptr

Template Parameters
StatusHandlerhandles returned status per key (see status_handlers)
Parameters
[in]keys_inkeys to consider
[in]num_innumber of keys
[out]num_outtotal number of values
[out]num_per_key_outnumber of values per key
[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 769 of file multi_value_hash_table.cuh.

◆ num_values() [3/3]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__device__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

total number of values inside the table

Parameters
[in]key_inkey to be probed
[out]num_outnumber of values associated to key_in*
[in]groupcooperative group
[in]probing_lengthmaximum number of probing attempts
Returns
status (per thread)

Definition at line 740 of file multi_value_hash_table.cuh.

◆ peek_status()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::peek_status ( const cudaStream_t  stream = 0) const
inlinenoexcept

get the status of the hash table

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

Definition at line 884 of file multi_value_hash_table.cuh.

◆ pop_status()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::pop_status ( const cudaStream_t  stream = 0)
inlinenoexcept

get and reset the status of the hash table

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

Definition at line 908 of file multi_value_hash_table.cuh.

◆ retrieve() [1/2]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, 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::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

retrieve a set of keys from the hash table

Note
this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr ) is provided
end_offsets_out can be begin_offsets_out+1
Template Parameters
StatusHandlerhandles returned 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]begin_offsets_outbegin of value range for a corresponding key in values_out
[out]end_offsets_outend of value range for a corresponding key in values_out
[out]num_outtotal number of values retrieved by this operation
[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 372 of file multi_value_hash_table.cuh.

◆ retrieve() [2/2]

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__device__ status_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

retrieves all values to a corresponding key

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

Definition at line 330 of file multi_value_hash_table.cuh.

◆ retrieve_all()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ void warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::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
inlinenoexcept

retrieves all elements from the hash table

Note
this method has a dry-run mode where it only calculates the needed array sizes in case no memory (aka nullptr ) is provided
this method implements a multi-stage dry-run mode
Parameters
[out]keys_outpointer to the set of unique keys
[out]num_keys_outnumber of unique keys
[out]begin_offsets_outbegin of value range for a corresponding key in values_out
[out]end_offsets_outend of value range for a corresponding key in values_out
[out]values_outarray which holds all retrieved values
[out]num_values_outtotal number of values retrieved by this operation
[in]streamCUDA stream in which this operation is executed in

Definition at line 524 of file multi_value_hash_table.cuh.

◆ retrieve_all_keys()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ void warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::retrieve_all_keys ( key_type *const  keys_out,
index_type num_out,
const cudaStream_t  stream = 0 
) const
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

Parameters
[out]keys_outretrieved unqiue keys
[out]num_outnumof unique keys
[in]streamCUDA stream in which this operation is executed in

Definition at line 562 of file multi_value_hash_table.cuh.

◆ size()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ index_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::size ( const cudaStream_t  stream = 0) const
inlinenoexcept

number of values stored inside the hash table

Parameters
[in]streamCUDA stream in which this operation is executed in
Returns
the number of values

Definition at line 813 of file multi_value_hash_table.cuh.

◆ storage_density()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
__host__ float warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::storage_density ( const cudaStream_t  stream = 0) const
inlinenoexcept

current storage density of the hash table

Parameters
[in]streamCUDA stream in which this operation is executed in
Returns
storage density

Definition at line 853 of file multi_value_hash_table.cuh.

◆ tombstone_key()

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
static constexpr __host____device__ key_type warpcore::MultiValueHashTable< Key, Value, EmptyKey, TombstoneKey, ProbingScheme, TableStorage, TempMemoryBytes >::tombstone_key ( )
inlinestaticconstexprnoexcept

get tombstone key

Returns
tombstone key

Definition at line 82 of file multi_value_hash_table.cuh.

Friends And Related Function Documentation

◆ kernels::for_each

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func , class Core >
GLOBALQUALIFIER friend void kernels::for_each ( Func  ,
const  Core 
)
friend

◆ kernels::for_each_unique_key

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Func , class Core >
GLOBALQUALIFIER friend void kernels::for_each_unique_key ( Func  ,
const  Core 
)
friend

◆ kernels::retrieve

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
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   
)
friend

◆ kernels::size

template<class Key , class Value , Key EmptyKey = defaults::empty_key<Key>(), Key TombstoneKey = defaults::tombstone_key<Key>(), class ProbingScheme = defaults::probing_scheme_t<Key, 8>, class TableStorage = defaults::table_storage_t<Key, Value>, index_t TempMemoryBytes = defaults::temp_memory_bytes()>
template<class Core >
GLOBALQUALIFIER friend void kernels::size ( index_type * const  ,
const  Core 
)
friend

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