For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
OpNode
struct OpNode
An operation in the Loop Dependency Graph (LDG).
Enriches OpDesc with resource assignment and latency β the information needed for modulo scheduling (GAG96). Each OpNode represents one vertex in the LDG.
Latencies are approximate and used for scheduling heuristics (ASAP/ALAP priority), not for cycle-accurate simulation. Typical values:
GLOBAL_MEM (buffer_load β LDS): ~200 cycles
LDS (ds_read β register): ~20 cycles
MMA_UNIT (MFMA execution): ~16 cycles
SCALAR (barriers, fences): ~0 cycles (sync, not compute)Fieldsβ
- βop (
OpDesc): The underlyingOpDescwith kind, stage, subtile, etc. - βresource (
ResourceKind): Hardware unit that executes this op (fromOpDesc.resource). - βlatency (
Int): Estimated cycles until the result is available.
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable
Methodsβ
__init__β
def __init__(out self, *, op: OpDesc, latency: Int = -1)
Create an OpNode from an OpDesc.
If latency is -1 (default), it is auto-derived from op.latency. Pass an explicit value to override.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!