Mojo struct
PackMatrixRows
struct PackMatrixRows[original_mut: Bool, //, dtype: DType, simd_size: Int, row_inner_size: Int, packed_origin: MutOrigin, original_origin: Origin[mut=original_mut], packed_layout: TensorLayout, original_layout: TensorLayout]
Pack rows from a matrix into the mlas packed layout and extract inner vectors of rows into the packed inner dimension, e.g. extract tile [X, Y] and pack into [Xo][Y][Xi].
Fieldsβ
- βpacked_matrix (
TileTensor[dtype, packed_layout, packed_origin]): - βoriginal_matrix (
TileTensor[dtype, original_layout, original_origin]): - βglobal_offset (
IndexList[2]): - βpack_tile_dim (
IndexList[2]): - βvalid_data_dim (
IndexList[2]): - βvalid_simd_dim (
IndexList[2]):
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable
Methodsβ
runβ
static run(packed_matrix: TileTensor[dtype, packed_layout, packed_origin], original_matrix: TileTensor[dtype, original_layout, original_origin], global_offset: IndexList[2], pack_tile_dim: IndexList[2], valid_data_dim: IndexList[2])
Interface function to run the packing routine. Args: packed_matrix: Pre-allocated buffer space for packed data. original_matrix: Data buffer containing the original matrix to pack. global_offset: Offset to use when indexing the original matrix. pack_tile_dim: 2D dimension tuple describing the size of the packed tile. valid_data_dim: 2D dimension tuple describing the amount of valid data on the global buffer starting from the offset.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!