Skip to main content

cufftSetStream

Function cufftSetStream 

Source
pub unsafe extern "C" fn cufftSetStream(
    plan: cufftHandle,
    stream: cudaStream_t,
) -> cufftResult
Expand description

Associates a CUDA stream with a cuFFT plan. All kernel launches made during plan execution are now done through the associated stream, enabling overlap with activity in other streams (e.g. data copying). The association remains until the plan is destroyed or the stream is changed with another call to cufftSetStream.

Note that starting from CUDA 11.2 (cuFFT 10.4.0), cufftSetStream is supported on multi-GPU plans. When associating a stream with a plan, cufftXtMemcpy() remains synchronous across the multiple GPUs. For previous versions of cuFFT, cufftSetStream will return an error in multiple GPU plans.

Note that starting from CUDA 12.2 (cuFFT 11.0.8), on multi-GPU plans, stream can be associated with any context on any GPU. However, repeated calls to cufftSetStream with streams from different contexts incur a small time penalty. Optimal performance is obtained when repeated calls to cufftSetStream use streams from the same CUDA context.

§Parameters

  • plan: The cufftHandle object to associate with the stream.
  • stream: A valid CUDA stream created with cudaStreamCreate(); 0 for the default stream.

§Return value