IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

ring_emit

def ring_emit[TraceBufT: TraceBuf, //, rings_per_cta: Int, ring_capacity: Int](trace_buf: TraceBufT, ring_base: Int, cta: Int, ring_id: Int, event_id: Int, payload: Int)

Appends one Section B record to the (cta, ring_id) ring.

Must be called by a SINGLE owner lane per (cta, ring_id) (monotone stamps). Stateless drop-oldest: reads WRITE_COUNT, writes the record's two words, stamps INFO on the first record, then writes WRITE_COUNT LAST (release order — a host snapshot never sees a count covering an unwritten record).

Parameters:

  • ​TraceBufT (TraceBuf): The trace-buffer type (inferred; only GmemTrace is ever instantiated since every call site is enable_trace-guarded).
  • ​rings_per_cta (Int): Rings carved per physical CTA.
  • ​ring_capacity (Int): Records per ring (drop-oldest beyond this).

Args:

  • ​trace_buf (TraceBufT): The device trace buffer.
  • ​ring_base (Int): First Section B slot (num_ctas * slots_per_cta).
  • ​cta (Int): Physical CTA index (block_idx.x).
  • ​ring_id (Int): Which ring this warp role owns.
  • ​event_id (Int): Event id (>= 40).
  • ​payload (Int): The u24 payload (see pack_payload2).

Was this page helpful?