Expand description
GraphActor — record a CUDA stream-capture once, replay many.
Two lifecycle paths:
- Caller-driven capture — user calls
stream.begin_capture()directly, performs operations, callsstream.end_capture()to get aCudaGraph, then wraps viaGraphHandle::from_graphand sendsLaunchto replay. - Actor-driven capture — caller sends
Record { script }; actor runsbegin_capture→ drives eachGraphOpin the script via itsrecordmethod →end_capture→ returns aGraphHandle.
Both paths produce the same GraphHandle type; on Launch the
actor validates state.generation() and replays the graph,
replying after stream completion.
§Open extension
GraphOp is a trait, not a closed enum. New kernel actors land
their ops by implementing GraphOp in their own module — no
central enum to edit. Legacy callers that built
GraphOpLegacy::Sgemm { ... } enum values still compile via the
GraphOpLegacy back-compat wrapper.
Re-exports§
pub use record::fft_r2c::FftR2COp;pub use record::memcpy::MemcpyOp;pub use record::rng_fill_uniform::RngFillUniformOp;pub use record::sgemm::SgemmOp;pub use child::ChildGraphOp;pub use dot::export_dot;pub use dot::DotFlags;pub use exec_update::exec_update;pub use exec_update::GraphExecUpdateOutcome;
Modules§
- child
- Child-graph composition.
- conditional
- Conditional graph nodes (
cudaGraphConditionalNode, CUDA 12.4+). - dot
cudaGraphDebugDotPrintround-trip — emit a Graphviz DOT file describing a captured graph for tooling / visualisation.- exec_
update cuGraphExecUpdate— in-place parameter update for an instantiated graph. Lets callers re-bindGpuRefpointers without re-runningcuGraphInstantiate.- record
- Per-op recorders that implement
super::GraphOp.
Structs§
- Graph
Actor - Graph
Handle - Graph
Record Ctx - Recording context handed to each
GraphOp::recordcall. - Send
Graph - Send/Sync newtype around
Arc<CudaGraph>. cudarc marksCudaGraph!Syncbecause of interior mutability via the CUDA driver. The actor enforces single-threaded access.
Enums§
- Graph
Msg - Graph
OpLegacy Deprecated - Back-compat wrapper preserving the closed-enum API of pre-0.5
graph ops. New code should construct the per-variant op types
(
SgemmOp,MemcpyOp,RngFillUniformOp,FftR2COp) directly and box them asBox<dyn GraphOp>.
Traits§
- GraphOp
- A single op in a graph script.
- Graph
OpRecord - Phase 3 record-mode trait. Lighter than
RecordMode(no associatedOptype) — implementors are typically one op carrying the typed request inline.