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 fornum_blocks * GEMV_TRACE_EVENTS_PER_BLOCKslots.
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:
- ptr (
UnsafePointer): Device-sideUnsafePointer[UInt64]with room fornum_blocks * GEMV_TRACE_EVENTS_PER_BLOCKslots, zero-initialized on first use.
store
store(self, offset: Int, val: UInt64)
Writes a timestamp into the device-side trace buffer.
Args:
get_type_name
static get_type_name() -> String
Returns the type name for runtime diagnostics.
Returns:
String: Always "GmemTrace".
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!