Skip to main content

cuStreamBeginRecaptureToGraph

Function cuStreamBeginRecaptureToGraph 

Source
pub unsafe extern "C" fn cuStreamBeginRecaptureToGraph(
    hStream: CUstream,
    mode: CUstreamCaptureMode,
    hGraph: CUgraph,
    callbackFunc: CUgraphRecaptureCallback,
    userData: *mut c_void,
) -> CUresult
Expand description

Begin graph capture on a stream to an existing graph.

Begin graph capture on hStream to the existing hGraph. The node creation order while recapturing the graph must be identical to the original graph. The recapture will fail immediately for:

  • Topology mismatches between the existing graph and the recaptured graph
  • Parameter mismatches for memory allocation or free nodes

Any other node parameter mismatches during recapture can be configured to call the function provided in callbackFunc. The recapture will fail immediately if the callback returns anything other than CUresult::CUDA_SUCCESS.

If the recapture fails for any reason, the graph will be in an undefined state and should be destroyed.

See cuStreamBeginCapture for additional detail on beginning the capture.

Note: Any user objects associated with graph will be released prior to the recapture.

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

§Parameters

  • hStream: Stream in which to initiate capture.
  • mode: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see cuThreadExchangeStreamCaptureMode.
  • hGraph: Existing CUDA graph to be captured into.
  • callbackFunc: Function that will be called for all parameter mismatches from the original graph.
  • userData: A generic pointer to user data that is passed into the callback function.

§Return value

See also: cuStreamCreate, cuStreamBeginCapture, cuStreamIsCapturing, cuStreamEndCapture, cuThreadExchangeStreamCaptureMode.