Skip to main content

Module common

Module common 

Source
Expand description

Shared host-side logic for GPU alignment: sequence encoding, traceback reconstruction, and partitioning.

Structs§

GpuAlignConfig
Configuration for GPU batch alignment.
SeqIndex
Index entry for one sequence pair on the GPU.

Constants§

TB_DIAG
Traceback direction encoding (4 bits per cell):
TB_E_OPEN
TB_F_OPEN
TB_H_MASK
TB_LEFT
TB_STOP
TB_UP

Functions§

encode_base
Encode a nucleotide as a 2-bit value: A=0, C=1, G=2, T/U=3, other=0.
encode_pairs
Pack sequences into a contiguous buffer for GPU transfer. Returns (packed bytes, index entries).
extract_scoring_params
Extract scoring parameters for GPU transfer (simple nucleotide mode).
extract_substitution_matrix
Extract the 24x24 substitution matrix as a flat i32 array, or None for simple scoring.
partition_pairs
Partition pairs into those suitable for GPU (within bandwidth) and those that need CPU fallback.
reconstruct_alignment
Reconstruct an AlignmentResult from GPU traceback data for a single pair.