IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

DepEdge

struct DepEdge

A dependency between two schedule entries.

Used for C2 (data dependence) validation: the producer entry must complete before the consumer entry can execute.

From the modulo scheduling paper, each edge in the Loop Dependency Graph has a loop distance d:

  • d=0: same-iteration dependency (producer and consumer in same iter)
  • d>=1: loop-carried dependency (consumer reads data from d iters ago)

The C2 constraint with loop distance is: Ο„(consumer) - Ο„(producer) >= latency(producer) - T * d

For d=0 (same iteration), this simplifies to the existing check: time_slot(consumer) > time_slot(producer)

Fields: producer_idx: Index of the producing entry in its phase's entry list. consumer_idx: Index of the consuming entry in its phase's entry list. dep_kind: Type of dependency (FLOW, ANTI, OUTPUT). loop_distance: Number of loop iterations between producer and consumer. 0 means same iteration, 1 means consumer uses data from previous iteration (e.g., WAR anti-dependency on double-buffered storage).

Fields​

  • ​producer_idx (Int):
  • ​consumer_idx (Int):
  • ​dep_kind (DepKind):
  • ​loop_distance (Int):

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable

Methods​

__init__​

__init__(out self, producer_idx: Int, consumer_idx: Int, dep_kind: DepKind, loop_distance: Int = 0)

flow​

static flow(producer: Int, consumer: Int, loop_distance: Int = 0) -> Self

anti​

static anti(producer: Int, consumer: Int, loop_distance: Int = 0) -> Self