Hash function code.
More...
#include <vector_types.h>
#include "definitions.h"
|
| CudaHT |
| Encapsulates the hash table library.
|
|
|
void | CudaHT::CuckooHashing::GenerateFunctions (const unsigned N, const unsigned num_keys, const unsigned *d_keys, const unsigned table_size, uint2 *constants) |
| Generates a set of linear hash function constants. More...
|
|
__device__ __host__ unsigned | CudaHT::CuckooHashing::hash_function_inner (const uint2 constants, const unsigned key) |
| Computes the value of a hash function for a given key. More...
|
|
template<unsigned kNumHashFunctions> |
__device__ __host__ unsigned | CudaHT::CuckooHashing::hash_function (const Functions< kNumHashFunctions > functions, const unsigned which_function, const unsigned key) |
| Computes the value of a hash function for a given key. More...
|
|
__device__ __host__ unsigned | CudaHT::CuckooHashing::stash_hash_function (const uint2 stash_constants, const unsigned key) |
| Simple hash function used by the stash.
|
|
void CudaHT::CuckooHashing::GenerateFunctions |
( |
const unsigned |
N, |
|
|
const unsigned |
num_keys, |
|
|
const unsigned * |
d_keys, |
|
|
const unsigned |
table_size, |
|
|
uint2 * |
constants |
|
) |
| |
Generates a set of linear hash function constants.
- Parameters
-
[in] | N | Number of hash functions. |
[out] | constants | CPU pointer to the constants. |
[in] | num_keys | Debug only: How many keys are in the input. |
[in] | d_keys | Debug only: Device memory array containing the input keys. |
[in] | table_size | Debug only: Size of the hash table. |
__device__ __host__ unsigned CudaHT::CuckooHashing::hash_function_inner |
( |
const uint2 |
constants, |
|
|
const unsigned |
key |
|
) |
| |
|
inline |
Computes the value of a hash function for a given key.
- Parameters
-
[in] | constants | Constants used by the hash function. ! |
[in] | key | Key being hashed. ! |
- Returns
- The value of the hash function for the key.
template<unsigned kNumHashFunctions>
__device__ __host__ unsigned CudaHT::CuckooHashing::hash_function |
( |
const Functions< kNumHashFunctions > |
functions, |
|
|
const unsigned |
which_function, |
|
|
const unsigned |
key |
|
) |
| |
|
inline |
Computes the value of a hash function for a given key.
- Parameters
-
[in] | functions | All of the constants used by the hash functions. ! |
[in] | which_function | Which hash function is being used. ! |
[in] | key | Key being hashed. ! |
- Returns
- The value of a hash function with a given key.