@@ -242,7 +242,7 @@ def MapOp : LinalgStructuredBase_Op<"map", [
242
242
on the corresponding elements.
243
243
244
244
Example:
245
- ```
245
+ ```mlir
246
246
%add = linalg.map
247
247
ins(%lhs, %rhs : tensor<64xf32>, tensor<64xf32>)
248
248
outs(%init: tensor<64xf32>)
@@ -256,7 +256,7 @@ def MapOp : LinalgStructuredBase_Op<"map", [
256
256
non-yield operation inside the body.
257
257
258
258
The example above will be printed as:
259
- ```
259
+ ```mlir
260
260
%add = linalg.map { arith.addf }
261
261
ins(%lhs, %rhs : tensor<64xf32>, tensor<64xf32>)
262
262
outs(%init: tensor<64xf32>)
@@ -327,7 +327,7 @@ def ReduceOp : LinalgStructuredBase_Op<"reduce", [
327
327
dimensions in increasing order.
328
328
329
329
Example:
330
- ```
330
+ ```mlir
331
331
%reduce = linalg.reduce
332
332
ins(%input:tensor<16x32x64xf32>)
333
333
outs(%init:tensor<16x64xf32>)
@@ -343,7 +343,7 @@ def ReduceOp : LinalgStructuredBase_Op<"reduce", [
343
343
takes `%out` as the first argument.
344
344
345
345
The example above will be printed as:
346
- ```
346
+ ```mlir
347
347
%reduce = linalg.reduce { arith.addf }
348
348
ins(%input:tensor<16x32x64xf32>)
349
349
outs(%init:tensor<16x64xf32>)
@@ -408,7 +408,7 @@ def TransposeOp : LinalgStructuredBase_Op<"transpose", [
408
408
operation only that produces a transposed "view".
409
409
410
410
Example:
411
- ```
411
+ ```mlir
412
412
%transpose = linalg.transpose
413
413
ins(%input:tensor<16x64xf32>)
414
414
outs(%init:tensor<64x16xf32>)
@@ -480,7 +480,7 @@ def BroadcastOp : LinalgStructuredBase_Op<"broadcast", [
480
480
Broadcast the input into the given shape by adding `dimensions`.
481
481
482
482
Example:
483
- ```
483
+ ```mlir
484
484
%bcast = linalg.broadcast
485
485
ins(%input:tensor<16xf32>)
486
486
outs(%init:tensor<16x64xf32>)
@@ -689,7 +689,7 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
689
689
the maps if specified.
690
690
691
691
Example Transpose:
692
- ```
692
+ ```mlir
693
693
linalg.matmul indexing_maps = [
694
694
affine_map<(d0, d1, d2) -> (d2, d0)>, // transpose
695
695
affine_map<(d0, d1, d2) -> (d2, d1)>,
@@ -700,7 +700,7 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
700
700
```
701
701
702
702
Example Broadcast:
703
- ```
703
+ ```mlir
704
704
linalg.matmul indexing_maps = [
705
705
affine_map<(d0, d1, d2) -> (d2)>, // broadcast
706
706
affine_map<(d0, d1, d2) -> (d2, d1)>,
@@ -711,7 +711,7 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
711
711
```
712
712
713
713
Example Broadcast and transpose:
714
- ```
714
+ ```mlir
715
715
linalg.matmul indexing_maps = [
716
716
affine_map<(d0, d1, d2) -> (d2, d0)>, // transpose
717
717
affine_map<(d0, d1, d2) -> (d2)>, // broadcast
@@ -839,7 +839,7 @@ def ContractOp : LinalgStructuredBase_Op<"contract", [
839
839
`H = ⟨ b, m, n ⟩` (with `k` as a contracting reduction-dimension while `m`,
840
840
`n` and `b` have parallel iteration-type) and gets represented as:
841
841
842
- ```
842
+ ```mlir
843
843
%D = linalg.contract
844
844
indexing_maps = [affine_map<(batch, m, n, k) -> (batch, m, k)>,
845
845
affine_map<(batch, m, n, k) -> (batch, k, n)>,
@@ -854,7 +854,7 @@ def ContractOp : LinalgStructuredBase_Op<"contract", [
854
854
For example, the following is a variant of batch-matmul with a transposition
855
855
applied to `A` while `B`'s 2D-matrix gets broadcasted along the batch dim:
856
856
857
- ```
857
+ ```mlir
858
858
linalg.contract
859
859
indexing_maps = [affine_map<(batch, m, n, k) -> (batch, k, m)>,
860
860
affine_map<(batch, m, n, k) -> (k, n)>,
@@ -953,7 +953,7 @@ def BatchMatmulOp : LinalgStructuredBase_Op<"batch_matmul", !listconcat([AttrSiz
953
953
arguments if specified.
954
954
955
955
Example Transpose:
956
- ```
956
+ ```mlir
957
957
linalg.batch_matmul indexing_maps = [
958
958
affine_map<(d0, d1, d2, d3) -> (d0, d3, d1)>, // transpose
959
959
affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)>,
@@ -964,7 +964,7 @@ def BatchMatmulOp : LinalgStructuredBase_Op<"batch_matmul", !listconcat([AttrSiz
964
964
```
965
965
966
966
Example Broadcast:
967
- ```
967
+ ```mlir
968
968
linalg.batch_matmul indexing_maps = [
969
969
affine_map<(d0, d1, d2, d3) -> (d3)>, // broadcast
970
970
affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)>,
@@ -975,7 +975,7 @@ def BatchMatmulOp : LinalgStructuredBase_Op<"batch_matmul", !listconcat([AttrSiz
975
975
```
976
976
977
977
Example Broadcast and Transpose:
978
- ```
978
+ ```mlir
979
979
linalg.batch_matmul indexing_maps = [
980
980
affine_map<(d0, d1, d2, d3) -> (d1, d3)>, // broadcast
981
981
affine_map<(d0, d1, d2, d3) -> (d0, d2, d3)>, // transpose
0 commit comments