3#include <cuda_runtime.h>
5#include <cub/warp/warp_reduce.cuh>
21template <
typename Config>
40template <
typename Config>
53template <
typename Config>
62template <
typename Config>
65#if __CUDA_ARCH__ >= 1000
74template <
typename Config, u
int64_t K>
85template <
typename Config, u
int64_t K>
92template <
typename Config>
96 if (
tile[
start +
i] == Config::Alphabet::invalidSymbol) {
108template <
typename Config>
110 const char* sequence,
128template <u
int32_t k_str
ide,
typename Config>
__device__ __forceinline__ bool prepare_sequence_hash_tiles(const char *sequence, uint64_t block_start_kmer, uint64_t block_kmers, uint8_t *sequence_tile)
Encodes a block's sequence slice into sequence_tile and reports global validity.
__device__ __forceinline__ void load128BitGlobalNC(const uint64_t *ptr, uint64_t &out0, uint64_t &out1)
Loads 128 bits from global memory using the non-coherent cache path.
__device__ __forceinline__ uint64_t advance_packed_kmer(uint64_t packed, uint8_t new_base)
Slides a packed k-mer window by one encoded base.
__device__ __forceinline__ void load_shard_words4(const filter_block< Config > *shards, uint64_t shard_index, uint64_t *w)
Loads four 64-bit shard words with 256-bit (sm_100+) or 128-bit vector loads.
__device__ __forceinline__ uint64_t packed_kmer_smer_hash(uint64_t packed_kmer, uint64_t start)
Bloom hash for the s-mer at start within a packed k-mer.
__device__ __forceinline__ uint64_t packed_kmer_minimizer_hash(uint64_t packed_kmer)
Minimum minimizer hash over all m-mers in a packed k-mer.
constexpr __host__ __device__ __forceinline__ uint64_t minimizer_hash64(uint64_t key)
Fast 64-bit hash sufficient for uniform minimizer selection.
__device__ __forceinline__ uint64_t pack_kmer_from_tile(const uint8_t *tile, uint64_t start)
Packs K encoded symbols from a shared-memory tile starting at start.
__device__ __forceinline__ bool kmer_is_valid(const uint8_t *tile, uint64_t start)
True when no symbol in the k-mer window is the alphabet invalid sentinel.
__device__ __forceinline__ void load256BitGlobalNC(const T *ptr, T *out)
Loads 256 bits from global memory using the non-coherent cache path.
__device__ __forceinline__ uint32_t build_stride_kmer_valid_mask(uint64_t thread_offset, uint64_t block_kmers, bool block_all_valid, const uint8_t *sequence_tile)
Builds the per-thread validity bitmask for strided query kernels.
constexpr uint64_t kInvalidHash
Sentinel hash value indicating "no valid minimizer found".
constexpr __host__ __device__ __forceinline__ uint64_t hash64(uint64_t key)
Fast 64-bit integer hash (non-cryptographic).
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...
static constexpr uint64_t symbolWidth
Input bytes per symbol.
static constexpr uint16_t s
S-mer width (Bloom hash seed) in symbols.
static constexpr uint64_t symbolMask
Low symbolBits mask for one encoded symbol.
static constexpr uint64_t minimizerSpan
M-mers evaluated per k-mer window.
static constexpr uint64_t cudaBlockSize
CUDA threads per kernel block.
static constexpr uint16_t k
K-mer length in symbols.
static constexpr uint64_t symbolBits
Bits per packed symbol in a uint64_t k-mer.
A span that is assumed to point to device-accessible memory.
One 256-bit filter block stored as an array of Config::blockWordCount words.