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

WaitCounts

struct WaitCounts

Per-phase wait/barrier counts, populated by repeated add calls.

Walk a phase with a comptime for and call counts.add(entry, i, n) per entry; n_combined tracks vm waits whose immediate successor is an lgkm wait (i.e., would coalesce into one s_waitcnt vmcnt(N) lgkmcnt(M) instruction at codegen time).

Fields​

  • ​n_vm (Int): Number of s_waitcnt vmcnt waits seen in the phase.
  • ​n_lgkm (Int): Number of s_waitcnt lgkmcnt waits seen in the phase.
  • ​n_combined (Int): Number of vm waits whose successor is an lgkm wait (codegen coalesces these into a single s_waitcnt vmcnt(N) lgkmcnt(M)).
  • ​n_barrier (Int): Number of s_barrier instructions in the phase.
  • ​n_sched_barrier (Int): Number of s_sched_group_barrier hints in the phase.

Implemented traits​

AnyType, Copyable, ImplicitlyDestructible, Movable

Methods​

empty​

static empty() -> Self

Returns a WaitCounts with every counter set to zero.

Returns:

Self: A zero-initialized WaitCounts.