Function cuStreamBeginCapture_v2

Source
pub unsafe extern "C" fn cuStreamBeginCapture_v2(
    hStream: CUstream,
    mode: CUstreamCaptureMode,
) -> CUresult
Expand description

\brief Begins graph capture on a stream

Begin graph capture on \p hStream. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graph, which will be returned via ::cuStreamEndCapture. Capture may not be initiated if \p stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via ::cuStreamIsCapturing. A unique id representing the capture sequence may be queried via ::cuStreamGetCaptureInfo.

If \p mode is not ::CU_STREAM_CAPTURE_MODE_RELAXED, ::cuStreamEndCapture must be called on this stream from the same thread.

\param hStream - Stream in which to initiate capture \param mode - Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see ::cuThreadExchangeStreamCaptureMode.

\note Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.

\return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_VALUE \notefnerr

\sa ::cuStreamCreate, ::cuStreamIsCapturing, ::cuStreamEndCapture, ::cuThreadExchangeStreamCaptureMode