pub struct GraphNode {
pub id: NodeId,
pub kind: NodeKind,
pub inputs: Vec<BufferId>,
pub outputs: Vec<BufferId>,
pub stream_hint: Option<StreamId>,
pub cost_hint: u64,
pub name: Option<String>,
}Expand description
A single node in the OxiCUDA computation graph.
Each node represents one GPU operation. Data-flow is captured through
explicit inputs and outputs buffer lists: an output buffer of one
node becomes an input buffer of its successors, forming the data
dependency graph alongside the explicit control dependency edges stored
in ComputeGraph.
Fields§
§id: NodeIdUnique identity within the graph.
kind: NodeKindThe GPU operation this node performs.
inputs: Vec<BufferId>Buffers consumed by this operation (read-only or read-write).
outputs: Vec<BufferId>Buffers produced or written by this operation.
stream_hint: Option<StreamId>Preferred stream for this node (hint to the stream partitioner).
cost_hint: u64Estimated compute cost in “abstract units” for scheduling heuristics.
name: Option<String>Optional human-readable name for debugging and profiling.
Implementations§
Source§impl GraphNode
impl GraphNode
Sourcepub fn new(id: NodeId, kind: NodeKind) -> Self
pub fn new(id: NodeId, kind: NodeKind) -> Self
Creates a new node with the given identity and operation kind.
Sourcepub fn with_inputs(self, inputs: impl IntoIterator<Item = BufferId>) -> Self
pub fn with_inputs(self, inputs: impl IntoIterator<Item = BufferId>) -> Self
Attaches input buffer references to this node (builder pattern).
Sourcepub fn with_outputs(self, outputs: impl IntoIterator<Item = BufferId>) -> Self
pub fn with_outputs(self, outputs: impl IntoIterator<Item = BufferId>) -> Self
Attaches output buffer references to this node (builder pattern).
Sourcepub fn with_stream(self, stream: StreamId) -> Self
pub fn with_stream(self, stream: StreamId) -> Self
Sets the preferred stream for this node (builder pattern).
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Sets the display name for this node (builder pattern).
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Returns the node’s display name, falling back to its ID.