|
cuDDL
|
Encodes genome records into register rows through a device arena. More...
Public Member Functions | |
| database_stager (cuda::stream_ref stream, staging_plan bounds, reference_build_statistics *statistics=nullptr, bool direct=false, cuda::std::optional< blacklist_view > blacklist=cuda::std::nullopt) | |
| ~database_stager () | |
| Frees the arenas only after every copy into them. | |
| database_stager (database_stager const &)=delete | |
| database_stager & | operator= (database_stager const &)=delete |
| Result< void > | add_genome (size_t genome, std::span< fastx_sequence_extent const > records, char const *pinned_base=nullptr, size_t pinned_size=0, std::unique_ptr< fastx_sequence_file > holder={}) |
| Stages one genome. | |
| Result< void > | add_packed_genome (size_t genome, std::unique_ptr< fastx_sequence_file > holder, char const *pinned_base=nullptr, size_t pinned_size=0) |
| Stages one genome that pack_fastx_sequence_file packed into two-bit runs. | |
| Result< void > | add_resident (size_t genome, char const *bases, size_t size) |
| Stages one genome's bases that already sit on the device, without a copy. | |
| Result< void > | begin_group (size_t genomes) |
| Clears the register rows of the next group of genomes. | |
| Result< device_span< uint32_t const > > | end_group (size_t genomes) |
| Launches everything staged and returns the group's rows on the device. | |
| Result< void > | finish () |
| Waits for the device and publishes the statistics. | |
| Result< void > | flush () |
| One launch for everything staged so far. | |
| void | wait_hold_slot () |
| Waits until the next genome staged by copy can be held without blocking. | |
Static Public Attributes | |
| static constexpr size_t | hold_slots = stager_hold_slots |
Encodes genome records into register rows through a device arena.
One copy of the staging machinery, fed by every entry point that builds a reference database from bases. A producer supplies, per genome, the spans of its records: one span per record, bases only, no line breaks, and no k-mer crossing two spans.
The arena, its descriptors, the record runs, the k - 1 overlap a record too large for the arena needs and the batch launches all live here. Rows stay on the device: each group's rows go to the caller's sink, which copies them wherever the build wants them. A producer keeps only what is its own: where the bytes come from, and which of them must outlive the copies the device makes from them.
Definition at line 222 of file database_staging.cuh.
|
inline |
| cuda::cuda_error | or std::bad_alloc when the device buffers cannot be allocated. |
| stream | Stream owning the arena, descriptors, and row store. |
| bounds | Arena sizing the device row store, arena, and descriptors. |
| statistics | Optional build statistics sink, null to skip. |
| direct | stages the caller's bytes in place, for a device that reads pageable host memory: no copy, and the arena stays unused. |
Definition at line 256 of file database_staging.cuh.
|
inline |
Frees the arenas only after every copy into them.
Definition at line 314 of file database_staging.cuh.
|
delete |
|
inline |
Stages one genome.
holder keeps its bytes alive until the device is done.
A genome with no records, or with records shorter than one window, keeps its row and records no descriptor. pinned_base names the page-locked buffer the bytes came from, when the producer has one, so the statistics can say which transfer path was taken.
Definition at line 326 of file database_staging.cuh.
|
inline |
Stages one genome that pack_fastx_sequence_file packed into two-bit runs.
Runs keep their words together. One too large for a batch splits into pieces of whole words whose window counts are multiples of sixteen, so every piece starts on a word.
Definition at line 428 of file database_staging.cuh.
|
inline |
Stages one genome's bases that already sit on the device, without a copy.
The bytes must stay valid until the batch that reads them runs: through the next flush, whose kernel the caller then orders its reuse of them after.
Definition at line 504 of file database_staging.cuh.
|
inline |
Clears the register rows of the next group of genomes.
Definition at line 512 of file database_staging.cuh.
|
inline |
Launches everything staged and returns the group's rows on the device.
Each genome's row holds BucketCount registers, the layout a single sketch allocation has. The rows are complete once the stream reaches this point, and the next begin_group reuses them, so a consumer enqueues its reads on the stager's stream before then.
Definition at line 529 of file database_staging.cuh.
|
inline |
Waits for the device and publishes the statistics.
Definition at line 535 of file database_staging.cuh.
|
inline |
One launch for everything staged so far.
Copies queued after it land in the arena only once the device has finished reading it, so no host wait is needed beyond the descriptor copy's own.
Definition at line 669 of file database_staging.cuh.
|
delete |
|
inline |
Waits until the next genome staged by copy can be held without blocking.
The thread that stages copied genomes may call this outside any lock it shares with other staging threads, so waiting on the transfers does not hold them up.
Definition at line 762 of file database_staging.cuh.
|
staticconstexpr |
Definition at line 248 of file database_staging.cuh.