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
ResourceKind
struct ResourceKind
Hardware resource that an operation occupies.
Each operation is assigned to a resource unit with a finite capacity. Two operations on the same resource at the same time slot contend. The resource also determines which wait counter tracks the operation:
GLOBAL_MEM β vmcnt (buffer_load instructions) LDS β lgkmcnt (ds_read / LDS instructions) MMA_UNIT β MFMA (matrix fused multiply-add) VALU β VALU (vector ALU: softmax, exp2, reductions) SCALAR β SALU (barriers, priority hints, fences) NONE β sentinel (no-op / not applicable)
On CDNA architectures, MMA_UNIT and VALU are independent execution units that can issue simultaneously. The scheduler models this by tracking separate free times for each, allowing MMA and VALU ops to overlap.
Implemented traitsβ
AnyType,
Copyable,
Equatable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
Writable
comptime membersβ
GLOBAL_MEMβ
comptime GLOBAL_MEM = ResourceKind(0)
LDSβ
comptime LDS = ResourceKind(1)
MMA_UNITβ
comptime MMA_UNIT = ResourceKind(2)
NONEβ
comptime NONE = ResourceKind(255)
SCALARβ
comptime SCALAR = ResourceKind(3)
VALUβ
comptime VALU = ResourceKind(4)
Vector ALU: parallel with MMA on CDNA architectures.
Methodsβ
write_toβ
write_to(self, mut writer: T)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!