Mojo struct
PackMatrixCols
struct PackMatrixCols[original_mut: Bool, //, original_shape: DimList, packed_shape: DimList, type: DType, simd_size: Int, column_inner_size: Int, use_vnni: Bool, use_i8mm: Bool, packed_origin: MutableOrigin, original_origin: Origin[original_mut]]
Pack columns from a matrix into the mlas packed layout and extract inner vectors of columns into the packed inner dimension, e.g. extracts [X, Y] and packs as [Yo][X][Yi].
Fields
- packed_matrix (
NDBuffer[type, 3, packed_origin, packed_shape]
): - original_matrix (
NDBuffer[type, 2, original_origin, original_shape]
): - global_offset (
Index[2]
): - pack_tile_dim (
Index[2]
): - valid_data_dim (
Index[2]
):
Implemented traits
AnyType
,
Copyable
,
ExplicitlyCopyable
,
Movable
,
UnknownDestructibility
Methods
run
static run(packed_matrix: NDBuffer[type, 3, MutableAnyOrigin, packed_shape], original_matrix: NDBuffer[type, 2, MutableAnyOrigin, original_shape], global_offset: Index[2], pack_tile_dim: Index[2], valid_data_dim: Index[2])
Interface function to run the packing routine. Args: packed_matrix(NDBuffer): pre-allocated buffer space for packed data. original_matrix(NDBuffer): data buffer containing the original matrix to pack. global_offset(IndexList): offset to use when indexing the original matrix. pack_tile_dim(IndexList): 2D dimension tuple describing the size of the packed tile. valid_data_dim(IndexList): 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!