pub unsafe fn launch_kernel(
func: CudaFunction,
grid: Dim3,
block: Dim3,
args: &mut [*mut c_void],
shared_mem: u32,
stream: CudaStream,
) -> CudaRtResult<()>Expand description
Launch a CUDA kernel.
Mirrors cudaLaunchKernel (with explicit function handle).
§Parameters
func— compiled kernel function (frommodule_get_function).grid— grid dimensions.block— block dimensions.args— mutable slice of pointers to kernel arguments; each element must point to the actual argument value, as required bycuLaunchKernel.shared_mem— dynamic shared memory in bytes.stream— CUDA stream on which to enqueue the launch.
§Safety
funcmust be a valid kernel handle.- Each
args[i]pointer must point to a value whose type matches the kernel’si-th parameter. shared_memmust not exceed the device’s maximum shared memory per block.
§Errors
Propagates driver errors.