Expand description
2026-09-25: KernelLaunch, the builder for kernel launches on any
GpuBackend. Each argument is recorded as a buffer or as scalar bytes, so the
Metal backend can bind buffers with setBuffer:offset:atIndex: and scalars with
setBytes:length:atIndex:.
Owner: gpu-runtime. Invariants:
- Each
arg_*call adds exactly oneKernelArgto the launch; aCUtensorMapoccupies 16 consecutive storage slots but is still one argument. - Arguments reach
GpuBackend::launch_typedin the order they were added.
Usage:
ⓘ
KernelLaunch::new(gpu, kernel)
.grid([num_tokens, 1, 1])
.block([256, 1, 1])
.arg_ptr(input)
.arg_u32(hidden_size)
.arg_f32(eps)
.launch(stream)?;Structs§
- Kernel
Launch - 2026-09-25: Builder for a kernel launch: grid, block, dynamic shared memory
and typed arguments.
launch()passes the arguments as&[KernelArg]toGpuBackend::launch_typed. Grid and block default to[1, 1, 1], shared memory to 0.
Functions§
- div_
ceil - 2026-09-25:
a / b, rounded up.