|
cuDDL
|
Keeps each genome's k most similar genomes from search tiles on the device.
More...
Public Member Functions | |
| Result< void > | add (batch_result_tile const &tile, cuda::stream_ref stream) |
Merges tile's passing pairs into the running neighbours, on stream. | |
| Result< std::vector< batch_search_result > > | download (cuda::stream_ref stream) const |
Each genome's neighbours, best first, genome by genome; waits for stream. | |
| uint32_t | k () const noexcept |
Static Public Member Functions | |
| static Result< top_k_search > | make (uint32_t genome_count, uint32_t reference_count, uint32_t bucket_count, uint32_t k, cuda::stream_ref stream, uint32_t first_genome_id=0U) |
Keeps each genome's k most similar genomes from search tiles on the device.
Pass add as the tile consumer of search_batch_async or search_all_to_all_async, for either the exhaustive or the indexed search, in place of downloading every passing pair. A genome's neighbours rank by weighted k-mer identity, the smaller ID first on a tie; a genome with fewer than k passing pairs keeps all of them.
Batch searches keep each query's best references, and all-to-all searches each database row's best other rows, in both directions of the stored upper triangle. Each genome keeps a min-heap of its k best. Per tile, one warp per query row merges the row's passing pairs into its genome's heap; for all-to-all tiles the pass bits are then transposed, and one warp per later genome merges its column of mirrored pairs. Each merging warp holds its genome's heap in shared memory and alone updates it, so no update takes a lock, and the work follows the passing pairs.
A collector sees only the tiles given to it. Replicas sharing an all-to-all tile queue each keep their own, and select_top_k merges their downloads.
|
inline |
Merges tile's passing pairs into the running neighbours, on stream.
The tile is one a search passes to its consumer, with results in their device slots.
Definition at line 371 of file top_k.cuh.
|
inline |
Each genome's neighbours, best first, genome by genome; waits for stream.
Definition at line 436 of file top_k.cuh.
|
inlinenoexcept |
|
inlinestatic |
| genome_count | Queries of a batch search, or rows of an all-to-all search. |
| reference_count | Database rows, the length of every result row. |
| bucket_count | Buckets per sketch, from which downloads recover both-empty counts. |
| first_genome_id | ID of the first query of a batch search; zero for all-to-all. |
Blocks use as many warps as their heaps fit the shared memory stream's device gives a block. Fails when one heap does not fit.
Definition at line 328 of file top_k.cuh.