Skip to main content

multi_stream_launch

Function multi_stream_launch 

Source
pub fn multi_stream_launch<A: KernelArgs>(
    kernel: &Kernel,
    streams: &[&Stream],
    params: &[LaunchParams],
    args: &[A],
) -> CudaResult<()>
Expand description

Launches the same kernel across multiple streams with per-stream parameters and arguments.

Each stream receives one launch with its corresponding parameters and arguments. The launches are issued sequentially to the driver but execute concurrently on the GPU (assuming the hardware supports concurrent kernel execution).

§Parameters

  • kernel — the kernel to launch on every stream.
  • streams — slice of streams to launch on.
  • params — per-stream launch parameters (grid, block, shared mem).
  • args — per-stream kernel arguments.

All three slices must have the same length.

§Errors

  • CudaError::InvalidValue if the slices have different lengths or are empty.
  • Any error from an individual kernel launch is returned immediately, aborting subsequent launches.