cuSBF
Loading...
Searching...
No Matches
superbloom_ffi.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6extern "C" {
7
14 uint16_t k,
15 uint16_t m,
16 uint16_t s,
17 size_t n_hashes,
18 uint8_t bit_vector_size_exponent,
19 uint8_t block_size_exponent
20);
21
27int64_t superbloom_insert_sequence(void* handle, const uint8_t* seq, size_t len);
28
34int64_t superbloom_insert_fastx_path(void* handle, const char* path);
35
41int64_t superbloom_query_sequence(const void* handle, const uint8_t* seq, size_t len);
42
48int64_t superbloom_query_fastx_path(const void* handle, const char* path);
49
55int32_t superbloom_freeze(const void* handle);
56
62int32_t superbloom_set_threads(void* handle, size_t n);
63
65uint64_t superbloom_filter_bits(const void* handle);
66
68void superbloom_destroy(void* handle);
69}
int32_t superbloom_freeze(const void *handle)
Freezes the filter for query-only access.
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_query_sequence(const void *handle, const uint8_t *seq, size_t len)
Queries a raw DNA sequence (freezes the filter first if needed).
uint64_t superbloom_filter_bits(const void *handle)
Total filter bits (2^bit_vector_size_exponent from create).
int64_t superbloom_query_fastx_path(const void *handle, const char *path)
Queries every FASTA/FASTQ record in a file (freezes first if needed).
int64_t superbloom_insert_fastx_path(void *handle, const char *path)
Inserts every FASTA/FASTQ record in a file into the filter (mutable mode).
void superbloom_destroy(void *handle)
Destroys a handle from superbloom_create.
int32_t superbloom_set_threads(void *handle, size_t n)
Sets the Rayon thread-pool size (call before insert/query).
int64_t superbloom_insert_sequence(void *handle, const uint8_t *seq, size_t len)
Inserts a raw DNA sequence into the filter (mutable mode).