Skip to main content

validate_launch

Function validate_launch 

Source
pub fn validate_launch(
    attrs: &KernelAttributes,
    limits: &DeviceLimits,
    block_size: u32,
    dynamic_shared_bytes: u32,
) -> Result<(), LaunchBudgetViolation>
Expand description

Validate one launch configuration against a compiled kernel and its device.

This is the register_budget equation, executable. It is pure — no CUDA, no global state — so the case table below runs anywhere, including the CPU-only required check.

§Errors

Returns the first LaunchBudgetViolation found. Checks are ordered cheapest-first and most-specific-first, so BlockExceedsKernelMax (the actionable one, naming the kernel’s own ceiling) is reported ahead of the device-wide limit.