pub struct ConditionalCudaGraphBody { /* private fields */ }Expand description
CUDA-owned body graph produced while adding one conditional-WHILE node.
The body graph and conditional handle are owned by the parent graph. They
must not be destroyed independently. The numeric handle is intended to be
passed by value to a device kernel that calls cudaGraphSetConditional.
Implementations§
Source§impl ConditionalCudaGraphBody
impl ConditionalCudaGraphBody
pub fn graph(&self) -> CUgraph
pub fn handle(&self) -> CUgraphConditionalHandle
pub fn context(&self) -> CUcontext
Sourcepub fn linear_chain_node_kinds(
&self,
) -> Result<Vec<CudaGraphNodeKind>, CudaConditionalGraphUnavailable>
pub fn linear_chain_node_kinds( &self, ) -> Result<Vec<CudaGraphNodeKind>, CudaConditionalGraphUnavailable>
Return this body’s actual node kinds in dependency-chain order.
The body must be a single linear dependency chain. CUDA’s node-list enumeration order is not used as an execution-order signal.
Sourcepub fn capture_on_stream<F, E>(
&self,
stream: &CudaStream,
record: F,
) -> Result<(), CudaConditionalGraphUnavailable>
pub fn capture_on_stream<F, E>( &self, stream: &CudaStream, record: F, ) -> Result<(), CudaConditionalGraphUnavailable>
Capture graph-compatible work directly into this conditional body.
stream must be a non-default stream. The callback must not allocate or
free CUDA memory, synchronize, or record/wait on events. Host-only
suballocation from retained device storage is allowed if it cannot grow
or remap that storage; captured addresses must remain valid and must not
be recycled while graph consumers or saved backward values need them.
CUDA conditional bodies allow only kernel, empty, child-graph, device
memcpy/memset, and nested conditional nodes.
Capture setup and cleanup may wait for deferred destruction under the
module-level lifecycle contract.