Expand description
The ComputeGraph — a directed acyclic graph of GPU operations.
ComputeGraph is the central data structure of oxicuda-graph. It
stores nodes (GPU operations), directed dependency edges, and buffer
descriptors. Analysis and optimisation passes operate on this structure
before it is lowered to an ExecutionPlan by the executor.
§Design
- Nodes are stored in a
Vecindexed by a denseu32slot. - Adjacency is maintained as two maps:
successorsandpredecessors, each mappingNodeId → Vec<NodeId>. This makes both forward and backward traversals O(degree). - Cycle detection happens eagerly on
add_edgeusing DFS, so the invariant “this graph is a DAG” always holds after successful mutation.
Structs§
- Compute
Graph - A directed acyclic graph (DAG) of GPU operations.