template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout>
class cuddl::query_sketch_batch< K, BucketCount, Layout >
Query sketches held on the device, in the shape a search consumes them.
A query is the winner score of every register, one uint16_t row per query genome, which is what reference_database::search_async and search_batch_async take. Sketching queries through reference_database_file would retain host score rows and labels that queries do not need. This keeps the sketches on the device in the shape a search wants, and nothing else.
The batch is move-only and owns its device allocation. Query IDs follow the order of the paths, or of the genomes handed to sketch_from_sequences. The allocating stream must outlive the batch, and @ref scores stays valid until the device work on that stream completes.
Definition at line 36 of file query_sketch.cuh.
template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout>
Sketches one query per plain or gzip/BGZF FASTA/FASTQ file on the GPU.
K-mers never cross record boundaries or ambiguous bases, exactly as a reference build treats them, and FASTQ qualities are validated and ignored. A file with no usable record keeps its query ID and scores zero everywhere.
Definition at line 68 of file query_sketch.cuh.
71 {}
72 ) try {
73 return [&]() -> Result<query_sketch_batch> {
75 CUDDL_TRY(batch.set_blacklist(options.blacklist, stream));
76 CUDDL_TRY((detail::stage_paths<K, BucketCount, Layout>(
77 paths,
78 stream,
79 options.staging_bytes,
80 options.parser_workers,
81 options.transfer,
82 options.decompression,
83 options.direct_reads,
84 options.statistics,
85 batch.reduce_rows(stream),
86 options.blacklist ? options.blacklist->get().view() :
cuda::std::nullopt
87 )));
88 return batch;
89 }();
90 } catch (cuda::cuda_error const& error) {
92 } catch (std::system_error const& error) {
94 } catch (std::bad_alloc const& error) {
96 }
query_sketch_batch(query_sketch_batch const &)=delete
#define CUDDL_TRY(expr)
Propagates a cuddl::Result failure from the enclosing function (GNU statement expression).
cuda::std::unexpected< Error > Err(Error error)
Failure return; converts to any Result<T> via cuda::std::unexpected.
static Error cuda(cudaError_t code, std::source_location location=std::source_location::current())
static Error resource(std::string message)
template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout>
Sketches one query per genome of bases the caller already holds.
Each genome supplies its records as spans of consecutive bases with the line breaks already removed, the shape a parsed FASTX record has, and the caller keeps every byte alive until this returns.
Definition at line 103 of file query_sketch.cuh.
106 {}
107 ) try {
108 return [&]() -> Result<query_sketch_batch> {
110 CUDDL_TRY(batch.set_blacklist(options.blacklist, stream));
111 CUDDL_TRY((detail::stage_sequences<K, BucketCount, Layout>(
112 genomes,
113 stream,
114 options.staging_bytes,
115 options.statistics,
116 batch.reduce_rows(stream),
117 options.blacklist ? options.blacklist->get().view() :
cuda::std::nullopt
118 )));
119 return batch;
120 }();
121 } catch (cuda::cuda_error const& error) {
122 return Err(
Error::cuda(
static_cast<cudaError_t
>(error.status())));
123 } catch (std::system_error const& error) {
125 } catch (std::bad_alloc const& error) {
127 }