GPU-Accelerated Cuckoo Filter
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
helpers.cuh File Reference
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <iostream>

Go to the source code of this file.

Namespaces

namespace  cuckoogpu
 
namespace  cuckoogpu::detail
 

Macros

#define SDIV(x, y)   (((x) + (y) - 1) / (y))
 Integer division with rounding up (ceiling).
 
#define CUDA_CALL(err)
 Macro for checking CUDA errors.
 

Functions

constexpr bool cuckoogpu::detail::powerOfTwo (size_t n)
 Checks if a number is a power of two.
 
__host__ __device__ __forceinline__ uint32_t cuckoogpu::detail::globalThreadId ()
 Calculates the global thread ID in a 1D grid.
 
constexpr size_t cuckoogpu::detail::nextPowerOfTwo (size_t n)
 Calculates the next power of two greater than or equal to n.
 
template<typename T >
size_t cuckoogpu::detail::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 cuckoogpu::detail::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 cuckoogpu::detail::hasZero (WordType v)
 Checks if a packed word contains a zero slot.
 
template<typename TagType , typename WordType >
__host__ __device__ __forceinline__ constexpr WordType cuckoogpu::detail::replicateTag (TagType tag)
 Replicates a tag value across all slots in a word.
 
template<typename Kernel >
constexpr size_t cuckoogpu::detail::maxOccupancyGridSize (int32_t blockSize, Kernel kernel, size_t dynamicSMemSize)
 Calculates the maximum occupancy grid size for a kernel.
 

Macro Definition Documentation

◆ CUDA_CALL

#define CUDA_CALL (   err)
Value:
do { \
cudaError_t err_ = (err); \
if (err_ == cudaSuccess) [[likely]] { \
break; \
} \
printf("%s:%d %s\n", __FILE__, __LINE__, cudaGetErrorString(err_)); \
exit(err_); \
} while (0)

Macro for checking CUDA errors.

Prints error message and exits if an error occurs.

Definition at line 204 of file helpers.cuh.

205 { \
206 cudaError_t err_ = (err); \
207 if (err_ == cudaSuccess) [[likely]] { \
208 break; \
209 } \
210 printf("%s:%d %s\n", __FILE__, __LINE__, cudaGetErrorString(err_)); \
211 exit(err_); \
212 } while (0)

◆ SDIV

#define SDIV (   x,
 
)    (((x) + (y) - 1) / (y))

Integer division with rounding up (ceiling).

Definition at line 198 of file helpers.cuh.