brintos

brintos / llvm-project-archived public Read only

0
0
Text · 603 B · 9c940e1 Raw
23 lines · python
1# RUN: %PYTHON -m mlir.dialects.linalg.opdsl.dump_oplib --file %s | FileCheck %s2 3from mlir.dialects.linalg.opdsl.lang import *4 5 6# CHECK: ---7# CHECK-LABEL: matmul8# CHECK:      implements:9# CHECK-NEXT: - LinalgContractionOpInterface10# CHECK:      defines:11# CHECK-NEXT: - hasCanonicalizer12@linalg_structured_op13def matmul(14    A=TensorDef(T, S.M, S.K),15    B=TensorDef(T, S.K, S.N),16    C=TensorDef(U, S.M, S.N, output=True),17):18    implements(ContractionOpInterface)19    defines(Canonicalizer)20    C[D.m, D.n] += TypeFn.cast_signed(U, A[D.m, D.k]) * TypeFn.cast_signed(21        U, B[D.k, D.n]22    )23