pub struct MFMAOperation<'c> { /* private fields */ }
Expand description
A mfma
operation. MLIR wrapper for CDNA mfma instructions.
The amdgpu.mfma
op is an MLIR wrapper around intrinsics
for various mfma
instructions in the CDNA architecture, which perform
multiple outer products in order to allow fast matrix multiplication.
The wrapper will select an appropriate mfma
instruction, if one is available,
based on the provided m
, k
, n
, and nBlks
attributes, along with the
types of the source and destination arguments.
For information on the layouts of the input and output matrces (which are stored
in sourceA
, sourceB
, destC
, and destD
), see the CDNA ISA documentation.
The cbsz
, abid
, and blgp
parameters control how the lanes of the wave
are permuted when matrix data is being loaded: blgp
can be any number of
fixed permutations, cbsz
specifies the log_2 of the number of chunks the lanes
holding sourceA are split into, and abid
selects one of those chunks.
Note, this wrapper allows specifying vector<4Kxi8>
arguments to MFMA
intrinsics that take an integer type of width 4K
. For example,
one can provide a vector<4xi8> as an argument to an MFMA instruction that
logically takes 4 i8s but whose intrinsics are specified to take an i32.
In these cases, the bytes in the vector will be concatenated in little-endian
order (that is, v[0] will go to arg[7:0], v[1] to arg[15:8] and so on).
The negateA, negateB, and negateC flags are only supported for double-precision operations on gfx940+.
Implementations§
source§impl<'c> MFMAOperation<'c>
impl<'c> MFMAOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> MFMAOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> MFMAOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset, Unset, Unset>
Creates a builder.