pub unsafe extern "C" fn cufftSetStream(
plan: cufftHandle,
stream: cudaStream_t,
) -> cufftResultExpand 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: ThecufftHandleobject to associate with the stream.stream: A valid CUDA stream created withcudaStreamCreate();0for the default stream.
§Return value
cufftResult::CUFFT_INVALID_PLAN: Theplanparameter is not a valid handle, or plan is multi-gpu in cuFFT version prior to 10.4.0.cufftResult::CUFFT_SUCCESS: The stream was associated with the plan.