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

alias __copyinit__is_trivial = True

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

BFLOAT16

alias BFLOAT16 = TensorMapDataType(9)

Brain floating-point 16-bit format.

FLOAT16

alias FLOAT16 = TensorMapDataType(6)

IEEE 754 16-bit floating-point.

FLOAT32

alias FLOAT32 = TensorMapDataType(7)

IEEE 754 32-bit floating-point.

FLOAT32_FTZ

alias FLOAT32_FTZ = TensorMapDataType(10)

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

FLOAT64

alias FLOAT64 = TensorMapDataType(8)

IEEE 754 64-bit floating-point.

INT32

alias INT32 = TensorMapDataType(3)

Signed 32-bit integer.

INT64

alias INT64 = TensorMapDataType(5)

Signed 64-bit integer.

TFLOAT32

alias TFLOAT32 = TensorMapDataType(11)

TensorFloat-32 format.

TFLOAT32_FTZ

alias TFLOAT32_FTZ = TensorMapDataType(12)

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

UINT16

alias UINT16 = TensorMapDataType(1)

Unsigned 16-bit integer.

UINT32

alias UINT32 = TensorMapDataType(2)

Unsigned 32-bit integer.

UINT64

alias UINT64 = TensorMapDataType(4)

Unsigned 64-bit integer.

UINT8

alias 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?