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 (Int): Index of the producing entry in its phase's entry list.
  • ​consumer_idx (Int): Index of the consuming entry in its phase's entry list.
  • ​dep_kind (DepKind): Type of dependency (FLOW, ANTI, or OUTPUT).
  • ​loop_distance (Int): Loop iterations between producer and consumer (0 = same iteration).

Implemented traits​

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDeletable, Movable

Methods​

__init__​

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

flow​

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

anti​

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