Skip to main content

Module graph

Module graph 

Source
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 Vec indexed by a dense u32 slot.
  • Adjacency is maintained as two maps: successors and predecessors, each mapping NodeId → Vec<NodeId>. This makes both forward and backward traversals O(degree).
  • Cycle detection happens eagerly on add_edge using DFS, so the invariant “this graph is a DAG” always holds after successful mutation.

Structs§

ComputeGraph
A directed acyclic graph (DAG) of GPU operations.