Skip to main content

Mojo struct

STMatrixOffsets

@register_passable(trivial) struct STMatrixOffsets[BM: Int, BN: Int, *, num_threads: Int, accum_type_size: Int, curr_repeat: Int, cumulative_repeat: Int, m_mma: Int]

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

b32_per_repeat

comptime b32_per_repeat = ((STMatrixLayout[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size].elements_per_repeat * accum_type_size) // 4)

local_frag_size_b32

comptime local_frag_size_b32 = (curr_repeat * STMatrixOffsets[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size, curr_repeat=curr_repeat, cumulative_repeat=cumulative_repeat, m_mma=m_mma].b32_per_repeat)

ptr_offset

comptime ptr_offset = (STMatrixOffsets[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size, curr_repeat=curr_repeat, cumulative_repeat=cumulative_repeat, m_mma=m_mma].b32_per_repeat * ((STMatrixLayout[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size].repeat * m_mma) + cumulative_repeat))

STLayout

comptime STLayout = STMatrixLayout[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size]

tmem_col_offset

comptime tmem_col_offset = ((cumulative_repeat * STMatrixLayout[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size].frag_simdwidth) * 4)

tmem_offset

comptime tmem_offset = ((STMatrixOffsets[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size, curr_repeat=curr_repeat, cumulative_repeat=cumulative_repeat, m_mma=m_mma].tmem_row_offset << 16) + STMatrixOffsets[BM, BN, num_threads=num_threads, accum_type_size=accum_type_size, curr_repeat=curr_repeat, cumulative_repeat=cumulative_repeat, m_mma=m_mma].tmem_col_offset)

tmem_row_offset

comptime tmem_row_offset = (16 * m_mma)

Methods

__init__

__init__() -> Self

Was this page helpful?