Expand description
Small utilities shared by the GPU memory and kernel-launch paths.
Everything here is pure CPU arithmetic; nothing touches a device except
get_optimal_backend, which probes scirs2_core::gpu for a usable
backend.
Functionsยง
- align_
size - Round
sizeup to the next multiple ofalignment. - calculate_
block_ size - Launch geometry for a 1-D kernel over
nelements. - calculate_
fragmentation - External fragmentation of a free list given as
(block_size, count)pairs. - checked_
next_ power_ of_ two - Smallest power of two greater than or equal to
n, orNoneon overflow. - format_
bytes - Format a byte count with a binary unit suffix.
- get_
optimal_ backend - First backend from
SUPPORTED_BACKENDS-style probing that opens a context. - is_
aligned - Whether
addrsits on analignmentboundary.