|
cuSBF
|
cuSBF GPU-accelerated sectorized Bloom filter. More...
Classes | |
| struct | Shard |
| One 256-bit filter block stored as an array of Config::blockWordCount words. More... | |
Public Member Functions | |
| Filter (uint64_t requestedFilterBits) | |
Constructs a Filter with at least requestedFilterBits bits of storage. | |
| Filter (const Filter &)=delete | |
| Filter & | operator= (const Filter &)=delete |
| Filter (Filter &&)=default | |
| Filter & | operator= (Filter &&)=default |
| ~Filter ()=default | |
| uint64_t | insertSequence (std::string_view sequence, cuda::stream_ref stream=cudaStream_t{}) |
| Inserts all valid k-mers from a host-resident sequence. | |
| uint64_t | insertSequenceDevice (device_span< const char > d_sequence, cuda::stream_ref stream=cudaStream_t{}) |
| Async insert of k-mers from a device-resident sequence. | |
| FastxInsertReport | insertRecordBatch (RecordBatchView batch, cuda::stream_ref stream=cudaStream_t{}) |
| Inserts a dense host-resident record batch. | |
| FastxInsertReport | insertFastx (std::istream &input, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) |
| Inserts all k-mers from a FASTA/FASTQ input stream. | |
| FastxInsertReport | insertFastxFile (std::string_view path, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) |
| Inserts all k-mers from a FASTA/FASTQ file via chunked streaming. | |
| void | containsSequenceDevice (device_span< const char > d_sequence, device_span< uint8_t > d_output, cuda::stream_ref stream=cudaStream_t{}) const |
| Async query of k-mers from a device-resident sequence. | |
| std::vector< uint8_t > | containsSequence (std::string_view sequence, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries all valid k-mers from a host-resident sequence. | |
| FastxQueryReport | queryRecordBatch (RecordBatchView batch, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries a dense host-resident record batch and returns aggregate counts. | |
| template<typename Consumer > | |
| FastxQueryReport | queryRecordBatch (RecordBatchView batch, Consumer &&consume, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries a dense host-resident record batch and streams per-record results. | |
| FastxQueryReport | queryFastx (std::istream &input, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries all k-mers from a FASTA/FASTQ input stream via chunked streaming. | |
| FastxQueryReport | queryFastxFile (std::string_view path, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries all k-mers from a FASTA/FASTQ file via chunked streaming. | |
| template<typename Consumer > | |
| FastxQueryReport | queryFastxRecords (std::istream &input, Consumer &&consume, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries a FASTA/FASTQ stream and emits one record result per parsed record. | |
| template<typename Consumer > | |
| FastxQueryReport | queryFastxFileRecords (std::string_view path, Consumer &&consume, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries a FASTA/FASTQ file and emits one record result per parsed record. | |
| FastxDetailedQueryReport | queryFastxDetailed (std::istream &input, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries all k-mers from a FASTA/FASTQ input stream via chunked streaming and preserves per-record hit vectors. | |
| FastxDetailedQueryReport | queryFastxFileDetailed (std::string_view path, double fillFraction=0.7, cuda::stream_ref stream=cudaStream_t{}) const |
| Queries all k-mers from a FASTA/FASTQ file via chunked streaming and preserves per-record hit vectors. | |
| void | clear (cuda::stream_ref stream=cudaStream_t{}) |
| Resets all filter bits to zero and synchronises the stream. | |
| float | loadFactor () const |
| Computes the fraction of set bits in the filter. | |
| uint64_t | filterBits () const |
| Returns the total allocated capacity of the filter in bits. | |
| uint64_t | numShards () const |
| Returns the number of shards. | |
cuSBF GPU-accelerated sectorized Bloom filter.
Stores an in-device cuSBF divided into numShards 256-bit shards. Each shard is independently addressed by a minimizer-derived hash, and bits within a shard are updated/tested by a set of s-mer-derived hashes.
The filter is not copyable (device memory ownership). Move construction and assignment are supported.
| Config | A cusbf::Config specialisation. |
Definition at line 338 of file BloomFilter.cuh.
|
inlineexplicit |
Constructs a Filter with at least requestedFilterBits bits of storage.
The actual allocated capacity is rounded up to the next power-of-two number of shards.
| requestedFilterBits | Desired filter capacity in bits. |
Definition at line 487 of file BloomFilter.cuh.
|
delete |
|
default |
|
default |
|
inline |
Resets all filter bits to zero and synchronises the stream.
| stream | CUDA stream to use. |
Definition at line 823 of file BloomFilter.cuh.
|
inline |
Queries all valid k-mers from a host-resident sequence.
Copies the sequence to device, queries, copies results back, and synchronises. The returned vector has one byte per k-mer: 1 = present, 0 = absent.
| sequence | Raw nucleotide sequence. |
| stream | CUDA stream to use. |
Definition at line 651 of file BloomFilter.cuh.
|
inline |
Async query of k-mers from a device-resident sequence.
Does not synchronise the stream. Results are written to d_output (one byte per k-mer: 1 = present, 0 = absent).
| d_sequence | Device-resident nucleotide sequence. |
| d_output | Per-k-mer result buffer (must hold kmerCount() bytes). |
| stream | CUDA stream to use. |
Definition at line 627 of file BloomFilter.cuh.
|
inline |
Returns the total allocated capacity of the filter in bits.
Definition at line 855 of file BloomFilter.cuh.
|
inline |
Inserts all k-mers from a FASTA/FASTQ input stream.
Reads records in streaming fashion, accumulating them until the concatenated sequence approaches fillFraction of free GPU memory, then inserts each chunk independently.
| input | Input stream containing FASTA or FASTQ records. |
| fillFraction | Fraction of free GPU memory to fill per chunk (default 0.7). |
| stream | CUDA stream to use. |
Definition at line 595 of file BloomFilter.cuh.
|
inline |
Inserts all k-mers from a FASTA/FASTQ file via chunked streaming.
Definition at line 608 of file BloomFilter.cuh.
|
inline |
Inserts a dense host-resident record batch.
batch.sequence stores the raw record payloads back-to-back without separators. batch.records stores ordered, non-overlapping byte ranges into that dense buffer. The filter injects alphabet separators between records internally, so callers do not need to materialise separator bytes themselves.
Synchronises before returning.
| batch | Dense record batch to insert. |
| stream | CUDA stream to use. |
Definition at line 569 of file BloomFilter.cuh.
|
inline |
Inserts all valid k-mers from a host-resident sequence.
Copies the sequence to device, launches the insert kernel, and synchronises before returning. K-mers containing characters outside {A,C,G,T,a,c,g,t} are skipped.
| sequence | Raw nucleotide sequence. |
| stream | CUDA stream to use (default: null stream). |
Definition at line 519 of file BloomFilter.cuh.
|
inline |
Async insert of k-mers from a device-resident sequence.
Does not synchronise the stream, the caller is responsible for ordering relative to downstream operations.
| d_sequence | Device-resident nucleotide sequence. |
| stream | CUDA stream to use. |
Definition at line 541 of file BloomFilter.cuh.
|
inline |
Computes the fraction of set bits in the filter.
Definition at line 839 of file BloomFilter.cuh.
|
inline |
Returns the number of shards.
Definition at line 860 of file BloomFilter.cuh.
|
delete |
|
default |
|
inline |
Queries all k-mers from a FASTA/FASTQ input stream via chunked streaming.
Definition at line 723 of file BloomFilter.cuh.
|
inline |
Queries all k-mers from a FASTA/FASTQ input stream via chunked streaming and preserves per-record hit vectors.
The returned report keeps aggregate counts plus one detailed record result in source order. Each detailed hit vector contains one byte per k-mer window: 1 = present, 0 = absent. Invalid-symbol windows remain in the vector as 0 and are excluded from queriedKmers.
Definition at line 795 of file BloomFilter.cuh.
|
inline |
Queries all k-mers from a FASTA/FASTQ file via chunked streaming.
Definition at line 736 of file BloomFilter.cuh.
|
inline |
Queries all k-mers from a FASTA/FASTQ file via chunked streaming and preserves per-record hit vectors.
Definition at line 809 of file BloomFilter.cuh.
|
inline |
Queries a FASTA/FASTQ file and emits one record result per parsed record.
Definition at line 774 of file BloomFilter.cuh.
|
inline |
Queries a FASTA/FASTQ stream and emits one record result per parsed record.
The callback receives record headers, record sequences, aggregate counts, and the per-window hit span for each record as soon as its chunk has been processed. The hit span remains valid only for the duration of the callback.
| input | Input stream containing FASTA or FASTQ records. |
| consume | Per-record callback. |
| fillFraction | Fraction of free GPU memory to fill per chunk (default 0.7). |
| stream | CUDA stream to use. |
Definition at line 759 of file BloomFilter.cuh.
|
inline |
Queries a dense host-resident record batch and streams per-record results.
The callback receives one RecordQueryView per input record in source order. The hit span remains valid only for the duration of the callback.
Synchronises before returning.
| batch | Dense record batch to query. |
| consume | Per-record callback. |
| stream | CUDA stream to use. |
Definition at line 710 of file BloomFilter.cuh.
|
inline |
Queries a dense host-resident record batch and returns aggregate counts.
batch.sequence stores raw record payloads back-to-back without separators. batch.records stores ordered, non-overlapping byte ranges into that dense buffer. The filter injects alphabet separators between records internally, so cross-record k-mers are never formed.
Synchronises before returning.
| batch | Dense record batch to query. |
| stream | CUDA stream to use. |
Definition at line 692 of file BloomFilter.cuh.