Skip to main content

cudaStreamWaitEvent

Function cudaStreamWaitEvent 

Source
pub unsafe extern "C" fn cudaStreamWaitEvent(
    stream: cudaStream_t,
    event: cudaEvent_t,
    flags: c_uint,
) -> cudaError_t
Expand description

Make a compute stream wait on an event.

Makes all future work submitted to stream wait for all work captured in event. See cudaEventRecord for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable. event may be from a different device than stream.

flags include:

Note: This function uses standard default stream semantics.

Note that this function may also return error codes from previous, asynchronous launches.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • stream: Stream to wait.
  • event: Event to wait on.
  • flags: Parameters for the operation(See above).

§Return value

See also: cudaStreamCreate, cudaStreamCreateWithFlags, cudaStreamQuery, cudaStreamSynchronize, cudaStreamAddCallback, cudaStreamDestroy, cuStreamWaitEvent.