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

GmemTrace

struct GmemTrace

HBM-backed trace buffer.

store(offset, ts) writes ts to ptr[offset]. 8 bytes of kernel arg.

Fields​

  • ​ptr (UnsafePointer[UInt64, MutAnyOrigin]): Device pointer to a u64 buffer sized for the caller's num_blocks * events_per_block slot count, zero-initialized on first use.

Implemented traits​

AnyType, Copyable, DevicePassable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TraceBuf, TrivialRegisterPassable

comptime members​

device_type​

comptime device_type = GmemTrace

Device-side type alias. GmemTrace is trivially device-passable.

Methods​

__init__​

__init__(ptr: UnsafePointer[UInt64, MutAnyOrigin]) -> Self

Wraps a device pointer as a trace buffer.

Args:

store​

store(self, offset: Int, val: UInt64)

Writes a timestamp into the device-side trace buffer.

Args:

  • ​offset (Int): Slot index.
  • ​val (UInt64): Timestamp value (ns).

get_type_name​

static get_type_name() -> String

Returns the type name for runtime diagnostics.

Returns:

String: Always "GmemTrace".