From 2beacda4f64b6321a5770e7f9565cdf6ca507271 Mon Sep 17 00:00:00 2001 From: Jakub Lichman Date: Thu, 11 Jun 2020 10:50:13 +0200 Subject: [PATCH] [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 --- mlir/docs/Dialects/Linalg.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mlir/docs/Dialects/Linalg.md b/mlir/docs/Dialects/Linalg.md index 4673a733..b383294 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, +func @example(%A: memref<8x?xf32, layout1>, %B: memref>) { - linalg.generic #attrs (%A, %B): memref, + linalg.generic #attrs (%A, %B): memref<8x?xf32, layout1>, memref> 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, +func @example(%A: memref<8x?xf32, layout1>, %B: memref>) { // 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> + %a = "load" %A, %j, %i: memref<8x?xf32> + %b = "load" %B, %j: memref> %c = "some_compute"(%a, %b): (f32, vector<4xf32>) -> (vector<4xf32>) - "store" %c, %3, %j: memref> + "store" %c, %B, %j: memref> } } return -- 2.7.4