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

A matrix_multiply operation. Vector matrix multiplication op that operates on flattened 1-D MLIR vectors.

This is the counterpart of llvm.matrix.multiply in MLIR. It serves the purposes of more progressive lowering and localized type conversion. Higher levels typically lower matrix multiplications into ‘vector.contract’ operations. Subsequent rewriting rule progressively lower these operations into ‘vector.matrix_multiply’ operations to bring the operations closer to the hardware ISA.

The ‘vector.matrix_multiply’ op treats lhs as matrix with <lhs_rows> rows and <lhs_columns> columns, rhs as matrix with <lhs_columns> rows and <rhs_columns> and multiplies them. The result matrix is returned embedded in the result vector.

Also see:

http://llvm.org/docs/LangRef.html#llvm-matrix-multiply-intrinsic

Example:

%C = vector.matrix_multiply %A, %B
  { lhs_rows = 4: i32, lhs_columns = 16: i32 , rhs_columns = 3: i32 } :
  (vector<64xf64>, vector<48xf64>) -> vector<12xf64>

Implementations§

source§

impl<'c> MatmulOperation<'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> ) -> MatmulOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset>

Creates a builder.

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

Trait Implementations§

source§

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

source§

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

Converts to this type from the input type.
source§

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

§

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

§

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

§

impl<'c> Unpin for MatmulOperation<'c>

§

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