Skip to main content

Module graph

Module graph 

Source
Expand description

CUDA Graphs (Runtime API).

Two construction paths match the Driver-side API:

  1. Stream capture (Stream::begin_capture, Stream::end_capture) — run your work on a stream; CUDA records it into a graph instead of executing. This is the usual path for applications.
  2. Explicit construction (Graph::new) — empty graph, add nodes by hand via the runtime’s cudaGraphAdd*Node functions (baracuda-runtime doesn’t expose typed builders for those yet — use stream capture, or drop down to the raw PFNs).

Either way, Graph::instantiate compiles to GraphExec, and GraphExec::launch runs it on any stream.

Structs§

Graph
A CUDA graph — DAG of operations, replayable via Graph::instantiate.
GraphExec
An instantiated (executable) CUDA graph.
GraphNode
A node inside a Graph. Lightweight Copy handle that borrows the parent graph’s storage.
UpdateResult
Outcome of GraphExec::update. result is a cudaGraphExecUpdateResult code — SUCCESS (0) means the executable graph was patched in place.

Enums§

CaptureMode
Stream-capture mode (matches cudaStreamCaptureMode).