Skip to main content

Mojo struct

TensorMapDataType

@register_passable(trivial) struct TensorMapDataType

Data type enumeration for TMA tensor map descriptors.

Specifies the element data type for TMA operations. The TMA hardware supports various numeric types including integers, floating-point, and specialized formats.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, Movable, UnknownDestructibility

Aliases

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

BFLOAT16

comptime BFLOAT16 = TensorMapDataType(9)

Brain floating-point 16-bit format.

FLOAT16

comptime FLOAT16 = TensorMapDataType(6)

IEEE 754 16-bit floating-point.

FLOAT32

comptime FLOAT32 = TensorMapDataType(7)

IEEE 754 32-bit floating-point.

FLOAT32_FTZ

comptime FLOAT32_FTZ = TensorMapDataType(10)

32-bit float with flush-to-zero for denormals.

FLOAT64

comptime FLOAT64 = TensorMapDataType(8)

IEEE 754 64-bit floating-point.

INT32

comptime INT32 = TensorMapDataType(3)

Signed 32-bit integer.

INT64

comptime INT64 = TensorMapDataType(5)

Signed 64-bit integer.

TFLOAT32

comptime TFLOAT32 = TensorMapDataType(11)

TensorFloat-32 format.

TFLOAT32_FTZ

comptime TFLOAT32_FTZ = TensorMapDataType(12)

TensorFloat-32 with flush-to-zero for denormals.

UINT16

comptime UINT16 = TensorMapDataType(1)

Unsigned 16-bit integer.

UINT32

comptime UINT32 = TensorMapDataType(2)

Unsigned 32-bit integer.

UINT64

comptime UINT64 = TensorMapDataType(4)

Unsigned 64-bit integer.

UINT8

comptime UINT8 = TensorMapDataType(0)

Unsigned 8-bit integer.

Methods

from_dtype

static from_dtype[dtype: DType]() -> Self

Converts a Mojo DType to the corresponding TMA data type.

Constraints:

The dtype must be float32, bfloat16, or float8_e4m3fn.

Parameters:

  • dtype (DType): The Mojo data type to convert. Must be one of DType.float32, DType.bfloat16, or DType.float8_e4m3fn.

Returns:

Self: The corresponding TensorMapDataType value.

Was this page helpful?