Skip to main content

launch_kernel

Function launch_kernel 

Source
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 (from module_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 by cuLaunchKernel.
  • shared_mem — dynamic shared memory in bytes.
  • stream — CUDA stream on which to enqueue the launch.

§Safety

  • func must be a valid kernel handle.
  • Each args[i] pointer must point to a value whose type matches the kernel’s i-th parameter.
  • shared_mem must not exceed the device’s maximum shared memory per block.

§Errors

Propagates driver errors.