pub fn fits_shared_memory(
kernel: &'static str,
requested: usize,
limits: &GpuLimits,
) -> Result<(), CubeclUtilsErrors>Expand description
Check a kernel’s shared-memory footprint against the device budget.
Over-allocating shared memory is silent: the kernel does no work, writes
nothing, and reports no error. Anything whose SharedMemory::new argument
depends on a user-facing parameter (a neighbour count, an embedding
dimensionality, a graph degree) needs this before the launch.
§Params
kernel- Kernel name, for the error message onlyrequested- Total bytes the kernel’s shared allocations add up tolimits- Device limits fromGpuLimits::from_client
§Returns
Ok(()) when it fits, SharedMemoryExceeded otherwise.