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>

source

pub fn name() -> &'static str

Returns a name.

source

pub fn as_operation(&self) -> &Operation<'c>

Returns a generic operation.

source

pub fn builder( context: &'c Context, location: Location<'c> ) -> MFMAOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset, Unset, Unset>

Creates a builder.

source

pub fn dest_d(&self) -> Result<OperationResult<'c, '_>, Error>

source

pub fn source_a(&self) -> Result<Value<'c, '_>, Error>

source

pub fn source_b(&self) -> Result<Value<'c, '_>, Error>

source

pub fn dest_c(&self) -> Result<Value<'c, '_>, Error>

source

pub fn m(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_m(&mut self, value: IntegerAttribute<'c>)

source

pub fn n(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_n(&mut self, value: IntegerAttribute<'c>)

source

pub fn k(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_k(&mut self, value: IntegerAttribute<'c>)

source

pub fn blocks(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_blocks(&mut self, value: IntegerAttribute<'c>)

source

pub fn cbsz(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_cbsz(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_cbsz(&mut self) -> Result<(), Error>

source

pub fn abid(&self) -> Result<IntegerAttribute<'c>, Error>

source

pub fn set_abid(&mut self, value: IntegerAttribute<'c>)

source

pub fn remove_abid(&mut self) -> Result<(), Error>

source

pub fn blgp(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_blgp(&mut self, value: Attribute<'c>)

source

pub fn remove_blgp(&mut self) -> Result<(), Error>

source

pub fn reduce_precision(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_reduce_precision(&mut self, value: Attribute<'c>)

source

pub fn remove_reduce_precision(&mut self) -> Result<(), Error>

source

pub fn negate_a(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_negate_a(&mut self, value: Attribute<'c>)

source

pub fn remove_negate_a(&mut self) -> Result<(), Error>

source

pub fn negate_b(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_negate_b(&mut self, value: Attribute<'c>)

source

pub fn remove_negate_b(&mut self) -> Result<(), Error>

source

pub fn negate_c(&self) -> Result<Attribute<'c>, Error>

source

pub fn set_negate_c(&mut self, value: Attribute<'c>)

source

pub fn remove_negate_c(&mut self) -> Result<(), Error>

Trait Implementations§

source§

impl<'c> From<MFMAOperation<'c>> for Operation<'c>

source§

fn from(operation: MFMAOperation<'c>) -> Self

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for MFMAOperation<'c>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(operation: Operation<'c>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'c> RefUnwindSafe for MFMAOperation<'c>

§

impl<'c> !Send for MFMAOperation<'c>

§

impl<'c> !Sync for MFMAOperation<'c>

§

impl<'c> Unpin for MFMAOperation<'c>

§

impl<'c> UnwindSafe for MFMAOperation<'c>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.