Skip to main content

optimal_align

Function optimal_align 

Source
pub fn optimal_align(
    shape: usize,
    elem_size: usize,
    buffer_align: usize,
) -> usize
Expand description

Calculates a best-effort heuristic for the alignment of row-aligned tensors. Prefers contiguous alignments for unit dimensions, 16-byte minimum alignment for non-unit, scaling with input size up to buffer_align.