pub struct WMMAOperation<'c> { /* private fields */ }
Expand description

A wmma operation. MLIR wrapper for RDNA3 wmma instructions.

The amdgpu.wmma op is an MLIR wrapper around intrinsics for various wmma instructions in the RDNA3 architecture, which perform a 16x16 matrix multiplication for different data types.

When emitting f16->f16 (or bf16->bf16) wmma the output is a 16xf16 (or 16xbf16) vector containing only 8 valid values:

  • If subwordOffset is 0, then the output is stored at indices 0, 2, 4, …, 14.
  • If subwordOffset is 1, then the output is stored at indices 1, 3, 5, …, 15.

unsignedA and unsignedB flag that the int8 LLVM inputs are unsigned.

The clamp flag is used to saturate the output of type T to numeric_limits::max() in case of overflow.

Implementations§

source§

impl<'c> WMMAOperation<'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> ) -> WMMAOperationBuilder<'c, 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 subword_offset(&self) -> Result<IntegerAttribute<'c>, Error>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

Trait Implementations§

source§

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

source§

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

Converts to this type from the input type.
source§

impl<'c> TryFrom<Operation<'c>> for WMMAOperation<'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 WMMAOperation<'c>

§

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

§

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

§

impl<'c> Unpin for WMMAOperation<'c>

§

impl<'c> UnwindSafe for WMMAOperation<'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.