cuDDL
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Enumerations | Functions | Variables
database_staging.cuh File Reference
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cstdint>
#include <cstring>
#include <deque>
#include <filesystem>
#include <future>
#include <limits>
#include <memory>
#include <mutex>
#include <optional>
#include <span>
#include <string_view>
#include <thread>
#include <utility>
#include <vector>
#include <unistd.h>
#include <cuda/algorithm>
#include <cuda/buffer>
#include <cuda/devices>
#include <cuda/memory_pool>
#include <cuda/stream>
#include <cuddl/detail/fastx_sequence_file.hpp>
#include <cuddl/detail/kernels.cuh>
#include <cuddl/detail/pinned_pool.cuh>
#include <cuddl/detail/sequence_encode.cuh>
#include <cuddl/device_span.cuh>
#include <cuddl/error.hpp>

Go to the source code of this file.

Classes

struct  cuddl::detail::staging_plan
 Sizing a build resolves before its first genome. More...
 
class  cuddl::detail::database_stager< K, BucketCount, Layout >
 Encodes genome records into register rows through a device arena. More...
 
struct  cuddl::detail::sequence_record
 One genome of bases the caller already holds. More...
 
struct  cuddl::detail::sequence_genome
 One genome as its records, in order. No records keeps the genome's ID with a zero row. More...
 
class  cuddl::detail::sequence_buffer_pool
 
class  cuddl::detail::path_loaders
 Loader state a build fed by paths keeps for its whole run. More...
 

Namespaces

namespace  cuddl
 Batch operations over contiguous device rows.
 
namespace  cuddl::detail
 

Macros

#define CUDDL_HAS_NVCOMP   0
 

Enumerations

enum class  cuddl::detail::decompression_backend : uint8_t {
  cuddl::detail::automatic , cuddl::detail::hybrid , cuddl::detail::cpu , cuddl::detail::gpu ,
  cuddl::detail::gpu_cores
}
 Where inputs are decompressed; sketch construction always runs on the GPU. More...
 
enum class  cuddl::detail::transfer_mode : uint8_t { cuddl::detail::automatic , cuddl::detail::in_place , cuddl::detail::pinned , cuddl::detail::staged }
 How a build gets CPU-parsed sequence bytes to the device. More...
 

Functions

bool cuddl::detail::device_reads_pageable_memory (cuda::device_ref device) noexcept
 Whether device reads pageable host memory itself.
 
bool cuddl::detail::stages_in_place (transfer_mode mode, cuda::device_ref device) noexcept
 Whether a build in mode stages the caller's bytes in place.
 
bool cuddl::detail::pages_locked (transfer_mode mode, cuda::device_ref device) noexcept
 Whether a build in mode decompresses into page-locked buffers.
 
Result< size_t > cuddl::detail::available_device_bytes (cuda::stream_ref stream)
 Device bytes an allocation on stream can still get.
 
template<uint32_t K, size_t BucketCount>
Result< staging_plan > cuddl::detail::plan_staging (size_t references, uint64_t staged_ceiling, std::optional< size_t > staging_bytes, cuda::stream_ref stream)
 Sizes the arena and the row store from free device memory and the corpus.
 
template<size_t BucketCount>
Result< void > cuddl::detail::download_store (device_span< uint32_t const > store, std::span< uint16_t > scores, cuda::stream_ref stream)
 Copies the winner scores of device store rows into host score rows.
 
decompression_target cuddl::detail::acquire_sequence_target (void *context, size_t bytes)
 decompression_source trampoline for sequence_buffer_pool.
 
template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout, typename Fill , typename Sink >
Result< void > cuddl::detail::stage_groups (size_t genomes, uint64_t staged_ceiling, std::optional< size_t > staging_bytes, cuda::stream_ref stream, reference_build_statistics *statistics, Fill &&fill, Sink &&sink, bool in_place=false, cuda::std::optional< blacklist_view > blacklist=cuda::std::nullopt)
 Runs the staging loop over a collection, filling one group at a time.
 
template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout, typename Sink >
Result< void > cuddl::detail::stage_paths (std::span< std::filesystem::path const > paths, cuda::stream_ref stream, std::optional< size_t > staging_bytes, unsigned parser_workers, transfer_mode transfer, decompression_backend decompression, bool direct_reads, reference_build_statistics *statistics, Sink &&sink, cuda::std::optional< blacklist_view > blacklist=cuda::std::nullopt)
 Stages a path collection, handing each group's device rows to sink.
 
template<uint32_t K, size_t BucketCount, typename Layout = default_register_layout, typename Sink >
Result< void > cuddl::detail::stage_sequences (std::span< sequence_genome const > genomes, cuda::stream_ref stream, std::optional< size_t > staging_bytes, reference_build_statistics *statistics, Sink &&sink, cuda::std::optional< blacklist_view > blacklist=cuda::std::nullopt)
 Stages bases the caller already holds, handing each group's device rows to sink.
 

Variables

constexpr size_t cuddl::detail::default_arena_ceiling = size_t{128} << 20
 Default arena ceiling.
 
constexpr size_t cuddl::detail::stager_arenas = 4
 Staging arenas the copy stream rotates through, so copies run ahead of the kernels that read earlier arenas while other work shares the device.
 
constexpr size_t cuddl::detail::stager_hold_slots = 16
 Host memory the device still has to read must stay alive: the transfer engine's read of a pageable buffer is not ordered with the host writes that follow it.
 
constexpr size_t cuddl::detail::packed_buffer_bytes = size_t{2} << 20
 Bytes reserved per loader buffer that holds packed bases: a bacterial genome's two-bit words, about 1.5 MB, fit.
 

Macro Definition Documentation

◆ CUDDL_HAS_NVCOMP

#define CUDDL_HAS_NVCOMP   0

Definition at line 30 of file database_staging.cuh.