Mojo struct
PackMatrixCols
struct PackMatrixCols[original_mut: Bool, //, original_shape: DimList, packed_shape: DimList, dtype: 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[dtype, 3, packed_origin, packed_shape]
): - original_matrix (
NDBuffer[dtype, 2, original_origin, original_shape]
): - global_offset (
IndexList[2]
): - pack_tile_dim (
IndexList[2]
): - valid_data_dim (
IndexList[2]
):
Implemented traits
AnyType
,
Copyable
,
ExplicitlyCopyable
,
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
Methods
run
static run(packed_matrix: NDBuffer[dtype, 3, MutableAnyOrigin, packed_shape], original_matrix: NDBuffer[dtype, 2, MutableAnyOrigin, original_shape], global_offset: IndexList[2], pack_tile_dim: IndexList[2], valid_data_dim: IndexList[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!