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 struct
CDNA4F8F6F4MatrixFormat
struct CDNA4F8F6F4MatrixFormat
Represents the CDNA4 f8f6f4 operand format selector.
Implemented traits
AnyType,
Copyable,
Deinitable,
Equatable,
ImplicitlyCopyable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime members
FLOAT4_E2M1
comptime FLOAT4_E2M1 = CDNA4F8F6F4MatrixFormat(Int(4))
FLOAT6_E2M3
comptime FLOAT6_E2M3 = CDNA4F8F6F4MatrixFormat(Int(2))
FLOAT6_E3M2
comptime FLOAT6_E3M2 = CDNA4F8F6F4MatrixFormat(Int(3))
FLOAT8_E4M3
comptime FLOAT8_E4M3 = CDNA4F8F6F4MatrixFormat(Int(0))
FLOAT8_E5M2
comptime FLOAT8_E5M2 = CDNA4F8F6F4MatrixFormat(Int(1))
Methods
__init__
def __init__(value: Int) -> Self
def __init__(mx_format: MXFormat) -> Self
Maps a vendor-neutral MX element format onto this CDNA4 selector.
Written out rather than passing the value through, so the neutral type's numbering stays independent of what the hardware happens to encode.
Args:
- mx_format (
MXFormat): The MX element format to select.
__eq__
bits_per_element
def bits_per_element(self) -> Int
Returns how many bits one operand element occupies.
Note this is the payload width, not the fragment width: 32 FP6
elements occupy 24 bytes but travel in a 32-byte fragment. Use
simd_width for the fragment.
Returns:
Int: The element width in bits.
simd_width
def simd_width(self) -> SIMDLength
Returns the operand fragment width, in bytes, this format expects.
FP6 holds only 24 payload bytes, but 24 is not a power of two, so it asks for 32. InstCombine narrows the operand back down, so the padding costs nothing. Stage FP6 loads as 24 bytes, not 32.
Returns:
SIMDLength: The fragment width in bytes.