Skip to main content

Module conditional

Module conditional 

Source
Expand description

Conditional graph nodes (cudaGraphConditionalNode, CUDA 12.4+).

Gated behind the graphs-conditional Cargo feature. Even with the feature on, the [GraphActor] runtime probe disables the path on older drivers — IfNodeDescriptor::record returns Unrecoverable("conditional graphs unsupported") if the cuGraphConditionalHandleCreate symbol can’t be resolved.

Public surface:

Structs§

IfNodeDescriptor
Descriptor for an If-style conditional node. The inner graph is out-parameter-allocated by CUDA when the node is created — callers receive its handle back so they can populate it before exec instantiation.
WhileNodeDescriptor
Descriptor for a While-style conditional node.

Enums§

ConditionalKind
Kind of conditional node. Matches CU_GRAPH_COND_TYPE_*.

Functions§

build_params
Build the raw CUDA_CONDITIONAL_NODE_PARAMS for kind against parent’s context. The returned struct embeds an out-pointer (phGraph_out) that CUDA fills with the inner graph; the actor adds it to the parent via cuGraphAddNode_v2.
driver_supports_conditional
Probe whether the running CUDA driver supports conditional graphs. Returns Ok(true) if cuGraphConditionalHandleCreate is callable (i.e. CUDA ≥ 12.4 with the symbol present); Ok(false) otherwise; Err(GpuError::Unrecoverable) if the loader panics.