|
GPU-Accelerated Cuckoo Filter
|
Functions | |
| template<typename Config > | |
| __global__ void | insertKernel (const typename Config::KeyType *keys, bool *output, size_t n, Filter< Config > *filter, uint32_t *evictionAttempts) |
| Kernel for inserting keys into the filter. | |
| template<typename Config > | |
| __global__ void | insertKernelSorted (const typename Filter< Config >::PackedTagType *packedTags, bool *output, size_t n, Filter< Config > *filter, uint32_t *evictionAttempts) |
| Kernel for inserting pre-sorted keys into the filter. | |
| template<typename Config > | |
| __global__ void | computePackedTagsKernel (const typename Config::KeyType *keys, typename Filter< Config >::PackedTagType *packedTags, size_t n, size_t numBuckets) |
| Kernel for computing packed tags for sorting. | |
| template<typename Config > | |
| __global__ void | containsKernel (const typename Config::KeyType *keys, bool *output, size_t n, Filter< Config > *filter) |
| Kernel for checking existence of keys. | |
| template<typename Config > | |
| __global__ void | deleteKernel (const typename Config::KeyType *keys, bool *output, size_t n, Filter< Config > *filter) |
| Kernel for deleting keys. | |
| constexpr bool | powerOfTwo (size_t n) |
| Checks if a number is a power of two. | |
| __host__ __device__ __forceinline__ uint32_t | globalThreadId () |
| Calculates the global thread ID in a 1D grid. | |
| constexpr size_t | nextPowerOfTwo (size_t n) |
| Calculates the next power of two greater than or equal to n. | |
| template<typename T > | |
| size_t | countOnes (T *data, size_t n) |
| Counts the number of non-zero elements in an array. | |
| template<typename TagType , typename WordType > | |
| __host__ __device__ __forceinline__ constexpr WordType | getZeroMask (WordType v) |
| Returns a bitmask indicating which slots in a packed word are zero. | |
| template<typename TagType , typename WordType > | |
| __host__ __device__ __forceinline__ constexpr bool | hasZero (WordType v) |
| Checks if a packed word contains a zero slot. | |
| template<typename TagType , typename WordType > | |
| __host__ __device__ __forceinline__ constexpr WordType | replicateTag (TagType tag) |
| Replicates a tag value across all slots in a word. | |
| template<typename Kernel > | |
| constexpr size_t | maxOccupancyGridSize (int32_t blockSize, Kernel kernel, size_t dynamicSMemSize) |
| Calculates the maximum occupancy grid size for a kernel. | |
| __global__ void cuckoogpu::detail::computePackedTagsKernel | ( | const typename Config::KeyType * | keys, |
| typename Filter< Config >::PackedTagType * | packedTags, | ||
| size_t | n, | ||
| size_t | numBuckets | ||
| ) |
Kernel for computing packed tags for sorting.
Definition at line 1498 of file CuckooFilter.cuh.
| __global__ void cuckoogpu::detail::containsKernel | ( | const typename Config::KeyType * | keys, |
| bool * | output, | ||
| size_t | n, | ||
| Filter< Config > * | filter | ||
| ) |
Kernel for checking existence of keys.
Definition at line 1460 of file CuckooFilter.cuh.
Counts the number of non-zero elements in an array.
| T | Type of elements. |
| data | Pointer to the array. |
| n | Number of elements. |
Definition at line 57 of file helpers.cuh.
| __global__ void cuckoogpu::detail::deleteKernel | ( | const typename Config::KeyType * | keys, |
| bool * | output, | ||
| size_t | n, | ||
| Filter< Config > * | filter | ||
| ) |
Kernel for deleting keys.
Definition at line 1475 of file CuckooFilter.cuh.
|
constexpr |
Returns a bitmask indicating which slots in a packed word are zero.
Uses SWAR (SIMD Within A Register) to check multiple items in parallel. See https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
The high bit of each slot that is zero will be set in the result.
| TagType | The type of the individual items (uint8_t, uint16_t, or uint32_t) |
| WordType | The packed word type (uint32_t or uint64_t) |
| v | The packed integer |
Definition at line 81 of file helpers.cuh.
| __host__ __device__ __forceinline__ uint32_t cuckoogpu::detail::globalThreadId | ( | ) |
Calculates the global thread ID in a 1D grid.
Definition at line 24 of file helpers.cuh.
|
constexpr |
Checks if a packed word contains a zero slot.
| TagType | The type of the individual items (uint8_t, uint16_t, or uint32_t) |
| WordType | The packed word type (uint32_t or uint64_t) |
| v | The packed integer |
Definition at line 116 of file helpers.cuh.
| __global__ void cuckoogpu::detail::insertKernel | ( | const typename Config::KeyType * | keys, |
| bool * | output, | ||
| size_t | n, | ||
| Filter< Config > * | filter, | ||
| uint32_t * | evictionAttempts | ||
| ) |
Kernel for inserting keys into the filter.
Definition at line 1422 of file CuckooFilter.cuh.
| __global__ void cuckoogpu::detail::insertKernelSorted | ( | const typename Filter< Config >::PackedTagType * | packedTags, |
| bool * | output, | ||
| size_t | n, | ||
| Filter< Config > * | filter, | ||
| uint32_t * | evictionAttempts | ||
| ) |
Kernel for inserting pre-sorted keys into the filter.
Definition at line 1522 of file CuckooFilter.cuh.
|
constexpr |
Calculates the maximum occupancy grid size for a kernel.
| Kernel | Type of the kernel function. |
| blockSize | Block size (threads per block). |
| kernel | The kernel function. |
| dynamicSMemSize | Dynamic shared memory size per block. |
Definition at line 224 of file helpers.cuh.
Calculates the next power of two greater than or equal to n.
| n | Input number. |
Definition at line 33 of file helpers.cuh.
Checks if a number is a power of two.
| n | Number to check. |
Definition at line 16 of file helpers.cuh.
|
constexpr |
Replicates a tag value across all slots in a word.
| TagType | The type of the tag (uint8_t, uint16_t, or uint32_t) |
| WordType | The target word type (uint32_t or uint64_t) |
| tag | The tag value to replicate |
Definition at line 129 of file helpers.cuh.