pub struct GraphExec { /* private fields */ }Expand description
An instantiated (executable) CUDA graph.
Implementations§
Source§impl GraphExec
impl GraphExec
Sourcepub fn launch(&self, stream: &Stream) -> Result<()>
pub fn launch(&self, stream: &Stream) -> Result<()>
Launch this graph on stream. Can be called repeatedly — that’s the
whole point of CUDA graphs.
Sourcepub fn as_raw(&self) -> CUgraphExec
pub fn as_raw(&self) -> CUgraphExec
Raw CUgraphExec. Use with care.
Sourcepub fn update(&self, new_template: &Graph) -> Result<UpdateResult>
pub fn update(&self, new_template: &Graph) -> Result<UpdateResult>
Try to update this executable graph in place based on a new
template graph. Returns Ok(info) in all cases — inspect
UpdateResult to distinguish success from the various
reasons CUDA refused the update. On refusal, the executable graph
is left unchanged (not corrupted), so the caller can fall back to
re-instantiating.
Only topology-invariant changes are allowed (same number + type of nodes, same dependency edges). Changes to kernel arguments, grid dims, memset values, memcpy params, etc. are supported.
Sourcepub unsafe fn set_kernel_node_params(
&self,
node: GraphNode,
params: &CUDA_KERNEL_NODE_PARAMS,
) -> Result<()>
pub unsafe fn set_kernel_node_params( &self, node: GraphNode, params: &CUDA_KERNEL_NODE_PARAMS, ) -> Result<()>
Live-edit a kernel-node’s parameters on the instantiated graph. Avoids re-instantiation when only arg values / grid dims / shmem change. The topology must match (no new nodes, no new edges).
§Safety
Same launch invariants as crate::LaunchBuilder::launch.
Sourcepub fn set_memcpy_node_params(
&self,
node: GraphNode,
params: &CUDA_MEMCPY3D,
) -> Result<()>
pub fn set_memcpy_node_params( &self, node: GraphNode, params: &CUDA_MEMCPY3D, ) -> Result<()>
Live-edit a memcpy-node’s parameters on the instantiated graph.
Sourcepub fn set_memset_node_params(
&self,
node: GraphNode,
params: &CUDA_MEMSET_NODE_PARAMS,
) -> Result<()>
pub fn set_memset_node_params( &self, node: GraphNode, params: &CUDA_MEMSET_NODE_PARAMS, ) -> Result<()>
Live-edit a memset-node’s parameters on the instantiated graph.