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>
impl<'c> MatmulOperation<'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>
) -> MatmulOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> MatmulOperationBuilder<'c, Unset, Unset, Unset, Unset, Unset, Unset>
Creates a builder.