Skip to main content

Module limits

Module limits 

Source
Expand description

Device limits and the dispatch geometry derived from them.

Everything in here except GpuLimits::from_client is a pure function of GpuLimits. That is deliberate: it means the behaviour on a device with half the shared memory, a quarter of the units per cube or a smaller plane can be asserted in a unit test on a machine that has none of those properties.

Structs§

GpuLimits
Every device limit that dispatch geometry and staging decisions depend on.

Functions§

checked_cube_count
Build a static cube count, checked against the device’s per-dimension limit.
fits_binding
Check a single allocation against the device’s per-binding size limit.
fits_shared_memory
Check a kernel’s shared-memory footprint against the device budget.
grid_2d
Split a flat cube count into a 2D grid within the device’s x/y limits.
grid_2d_limited
Split a flat cube count into a 2D grid bounded by max_dim per dimension.
plane_partitions
How many whole planes a wg_size-wide workgroup divides into.
plane_uniform
Whether a wg_size-wide workgroup is guaranteed to be exactly one plane.
resident_workgroups
How many workgroups of a given shared-memory footprint stay resident.
resolve_workgroup_size
Make a preferred workgroup width legal on the target device.