Skip to main content

fits_binding

Function fits_binding 

Source
pub fn fits_binding(
    requested: u64,
    limits: &GpuLimits,
) -> Result<(), CubeclUtilsErrors>
Expand description

Check a single allocation against the device’s per-binding size limit.

Two ceilings exist and they disagree: total device memory, and the largest buffer that can be bound to one kernel argument. A wave of work can fit the former while a single tensor busts the latter, and busting it is silent. On wgpu the limit is max_storage_buffer_binding_size, which is 4 GiB on Apple Silicon but as little as 128 MiB on parts that report only the WebGPU defaults.

§Params

§Returns

Ok(()) when it fits, BindingTooLarge otherwise.