Skip to main content

Mojo struct

TensorMapDataType

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, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

comptime members

BFLOAT16

comptime BFLOAT16 = TensorMapDataType(SIMD(9))

Brain floating-point 16-bit format.

FLOAT16

comptime FLOAT16 = TensorMapDataType(SIMD(6))

IEEE 754 16-bit floating-point.

FLOAT32

comptime FLOAT32 = TensorMapDataType(SIMD(7))

IEEE 754 32-bit floating-point.

FLOAT32_FTZ

comptime FLOAT32_FTZ = TensorMapDataType(SIMD(10))

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

FLOAT64

comptime FLOAT64 = TensorMapDataType(SIMD(8))

IEEE 754 64-bit floating-point.

INT32

comptime INT32 = TensorMapDataType(SIMD(3))

Signed 32-bit integer.

INT64

comptime INT64 = TensorMapDataType(SIMD(5))

Signed 64-bit integer.

TFLOAT32

comptime TFLOAT32 = TensorMapDataType(SIMD(11))

TensorFloat-32 format.

TFLOAT32_FTZ

comptime TFLOAT32_FTZ = TensorMapDataType(SIMD(12))

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

UINT16

comptime UINT16 = TensorMapDataType(SIMD(1))

Unsigned 16-bit integer.

UINT32

comptime UINT32 = TensorMapDataType(SIMD(2))

Unsigned 32-bit integer.

UINT64

comptime UINT64 = TensorMapDataType(SIMD(4))

Unsigned 64-bit integer.

UINT8

comptime UINT8 = TensorMapDataType(SIMD(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 one of the supported types listed above.

Parameters:

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

Returns:

Self: The corresponding TensorMapDataType value.

Was this page helpful?