3#include <cuda_runtime.h>
27template <u
int64_t Index>
32 static constexpr uint64_t value = 0x9E37'79B9'7F4A'7C15ULL;
36 static constexpr uint64_t value = 0xC2B2'AE3D'27D4'EB4FULL;
40 static constexpr uint64_t value = 0x1656'67B1'9E37'79F9ULL;
44 static constexpr uint64_t value = 0x85EB'CA77'C2B2'AE63ULL;
48 static constexpr uint64_t value = 0x27D4'EB2F'1656'67C5ULL;
52 static constexpr uint64_t value = 0x94D0'49BB'1331'11EFULL;
56 static constexpr uint64_t value = 0xBF58'476D'1CE4'E5B9ULL;
60 static constexpr uint64_t value = 0xD6E8'FEB8'6659'FD93ULL;
64 static constexpr uint64_t value = 0xA076'1D64'78BD'642FULL;
68 static constexpr uint64_t value = 0xE703'7ED1'A0B4'28DBULL;
72 static constexpr uint64_t value = 0x8EBC'6AF0'9C88'C6E3ULL;
76 static constexpr uint64_t value = 0x5899'65CC'7537'4CC3ULL;
80 static constexpr uint64_t value = 0x1D8E'4E27'C47D'124FULL;
84 static constexpr uint64_t value = 0xEB44'9C93'FBBE'A6B5ULL;
88 static constexpr uint64_t value = 0xDB4F'0B91'75AE'2165ULL;
92 static constexpr uint64_t value = 0xBBE0'56FD'ADE1'4B91ULL;
96template <u
int64_t Index>
98 static_assert(
Index < 16,
"Salt index out of range");
106 (
fn(std::integral_constant<uint64_t, HashIndices>{}), ...);
110template <
typename Config,
typename Fn>
113 static_cast<Fn&&
>(
fn), std::make_index_sequence<Config::hashCount>{}
118template <
typename Config, u
int64_t Length>
121 return std::numeric_limits<uint64_t>::max();
128template <
typename Config, u
int64_t WindowLength, u
int64_t K>
131 static_assert(
WindowLength <=
K,
"WindowLength must not exceed K");
138 atomicOr(
reinterpret_cast<unsigned long long*
>(
ptr),
static_cast<unsigned long long>(value));
__host__ __device__ __forceinline__ constexpr uint64_t extractPackedSubwindow(uint64_t packed_kmer, uint64_t start)
Extracts an m-mer or s-mer subwindow from a packed k-mer at start.
__host__ __device__ __forceinline__ void forEachHashIndexImpl(Fn &&fn, std::index_sequence< HashIndices... >)
Unrolled invocation of fn for each Bloom hash index in Config.
__host__ __device__ __forceinline__ void forEachHashIndex(Fn &&fn)
Invokes fn once per Bloom hash index (compile-time unrolled).
constexpr uint32_t kContainsSequenceStride
K-mers processed per query thread per inner loop iteration.
__device__ __forceinline__ void atomicOrWord(uint64_t *ptr, uint64_t value)
64-bit atomic OR used for sectorized Bloom inserts.
constexpr uint64_t kInvalidHash
Sentinel hash value indicating "no valid minimizer found".
__host__ __device__ __forceinline__ constexpr uint64_t multiplicativeSaltLiteral()
Compile-time multiplicative salt for Bloom hash index Index.
consteval bool separatorPositionAlwaysEncodesInvalid(char *input, uint64_t separatorPosition, uint64_t index)
Recursively tests whether placing the separator byte at any position in an input of valid bytes alway...
__host__ __device__ __forceinline__ constexpr uint64_t packedWindowMask()
Bit mask retaining the low Length symbols of a packed k-mer.
Compile-time configuration for a cusbf::filter.
static constexpr uint64_t symbolBits
Bits per packed symbol in a uint64_t k-mer.
Device functor for bitwise OR reduction (CUB WarpReduce).
__host__ __device__ __forceinline__ T operator()(T lhs, T rhs) const