[Mlir-commits] [mlir] 2beacda - [mlir][Linalg][Doc] Fix of misleading example in Property 2
Alex Zinenko
llvmlistbot at llvm.org
Thu Jun 11 01:50:42 PDT 2020
Author: Jakub Lichman
Date: 2020-06-11T10:50:34+02:00
New Revision: 2beacda4f64b6321a5770e7f9565cdf6ca507271
URL: https://github.com/llvm/llvm-project/commit/2beacda4f64b6321a5770e7f9565cdf6ca507271
DIFF: https://github.com/llvm/llvm-project/commit/2beacda4f64b6321a5770e7f9565cdf6ca507271.diff
LOG: [mlir][Linalg][Doc] Fix of misleading example in Property 2
Code example in MLIR Linalg doc fixed because it referenced non-existing variables and some parameters were of wrong types.
Differential Revision: https://reviews.llvm.org/D81633
Added:
Modified:
mlir/docs/Dialects/Linalg.md
Removed:
################################################################################
diff --git a/mlir/docs/Dialects/Linalg.md b/mlir/docs/Dialects/Linalg.md
index 4673a7330330..b383294ffd74 100644
--- a/mlir/docs/Dialects/Linalg.md
+++ b/mlir/docs/Dialects/Linalg.md
@@ -130,9 +130,9 @@ Consider the following, partially specified, `linalg.generic` example:
(i, j) -> (j)
}
#attrs = {args_in: 1, args_out: 1, indexings: indexing_maps}
-func @example(%A: memref<?xf32, layout1>,
+func @example(%A: memref<8x?xf32, layout1>,
%B: memref<?xvector<4xf32, layout2>>) {
- linalg.generic #attrs (%A, %B): memref<?xf32, layout1>,
+ linalg.generic #attrs (%A, %B): memref<8x?xf32, layout1>,
memref<?xvector<4xf32, layout2>>
return
}
@@ -142,21 +142,21 @@ The property "*Reversible Mappings Between Control and Data Structures*" is
materialized by a lowering into a form that will resemble:
```
#attrs = {args_in: 1, args_out: 1, indexings: indexing_maps}
-func @example(%A: memref<?xf32, layout1>,
+func @example(%A: memref<8x?xf32, layout1>,
%B: memref<?xvector<4xf32, layout2>>) {
// loop bounds determined from data sizes by “inverting the map”
- %J = "dim" %2, 0: index
- %I = "dim" %2, 1: index
- %J2 = "dim" %3, 0: index
+ %J = "dim" %A, 0: index
+ %I = "dim" %A, 1: index
+ %J2 = "dim" %B, 0: index
// iteration space is consistent with data + mapping inference
%eq = "eq" %J, %J2: i1
"assert" %eq: (i1) -> ()
for %i = 0 to %I { // loop order is fully defined by indexing maps
for %j = 0 to %J { // arbitrary permutations are possible
- %a = "load" %2, %j, %i: memref<8x?xf32>
- %b = "load" %3, %j: memref<?xvector<4xf32>>
+ %a = "load" %A, %j, %i: memref<8x?xf32>
+ %b = "load" %B, %j: memref<?xvector<4xf32>>
%c = "some_compute"(%a, %b): (f32, vector<4xf32>) -> (vector<4xf32>)
- "store" %c, %3, %j: memref<?xvector<4xf32>>
+ "store" %c, %B, %j: memref<?xvector<4xf32>>
}
}
return
More information about the Mlir-commits
mailing list