cuSBF
Loading...
Searching...
No Matches
Functions
superbloom_ffi.hpp File Reference
#include <cstddef>
#include <cstdint>
Include dependency graph for superbloom_ffi.hpp:

Go to the source code of this file.

Functions

void * superbloom_create (uint16_t k, uint16_t m, uint16_t s, size_t n_hashes, uint8_t bit_vector_size_exponent, uint8_t block_size_exponent)
 Creates a SuperBloom filter with the given configuration.
 
int64_t superbloom_insert_sequence (void *handle, const uint8_t *seq, size_t len)
 Inserts a raw DNA sequence into the filter (mutable mode).
 
int64_t superbloom_insert_fastx_path (void *handle, const char *path)
 Inserts every FASTA/FASTQ record in a file into the filter (mutable mode).
 
int64_t superbloom_query_sequence (const void *handle, const uint8_t *seq, size_t len)
 Queries a raw DNA sequence (freezes the filter first if needed).
 
int64_t superbloom_query_fastx_path (const void *handle, const char *path)
 Queries every FASTA/FASTQ record in a file (freezes first if needed).
 
int32_t superbloom_freeze (const void *handle)
 Freezes the filter for query-only access.
 
int32_t superbloom_set_threads (void *handle, size_t n)
 Sets the Rayon thread-pool size (call before insert/query).
 
uint64_t superbloom_filter_bits (const void *handle)
 Total filter bits (2^bit_vector_size_exponent from create).
 
void superbloom_destroy (void *handle)
 Destroys a handle from superbloom_create.
 

Function Documentation

◆ superbloom_create()

void * superbloom_create ( uint16_t  k,
uint16_t  m,
uint16_t  s,
size_t  n_hashes,
uint8_t  bit_vector_size_exponent,
uint8_t  block_size_exponent 
)

Creates a SuperBloom filter with the given configuration.

Returns
Opaque handle, or NULL on failure.

◆ superbloom_destroy()

void superbloom_destroy ( void *  handle)

Destroys a handle from superbloom_create.

◆ superbloom_filter_bits()

uint64_t superbloom_filter_bits ( const void *  handle)

Total filter bits (2^bit_vector_size_exponent from create).

◆ superbloom_freeze()

int32_t superbloom_freeze ( const void *  handle)

Freezes the filter for query-only access.

Returns
0 on success, -1 on error.

◆ superbloom_insert_fastx_path()

int64_t superbloom_insert_fastx_path ( void *  handle,
const char *  path 
)

Inserts every FASTA/FASTQ record in a file into the filter (mutable mode).

Returns
Total k-mers added, or -1 on error.

◆ superbloom_insert_sequence()

int64_t superbloom_insert_sequence ( void *  handle,
const uint8_t *  seq,
size_t  len 
)

Inserts a raw DNA sequence into the filter (mutable mode).

Returns
Number of k-mers added, or -1 on error.

◆ superbloom_query_fastx_path()

int64_t superbloom_query_fastx_path ( const void *  handle,
const char *  path 
)

Queries every FASTA/FASTQ record in a file (freezes first if needed).

Returns
Total positive k-mers, or -1 on error.

◆ superbloom_query_sequence()

int64_t superbloom_query_sequence ( const void *  handle,
const uint8_t *  seq,
size_t  len 
)

Queries a raw DNA sequence (freezes the filter first if needed).

Returns
Number of k-mers reported present, or -1 on error.

◆ superbloom_set_threads()

int32_t superbloom_set_threads ( void *  handle,
size_t  n 
)

Sets the Rayon thread-pool size (call before insert/query).

Returns
0 on success, -1 on error.