Fix attribute dict syntax in the docs
authorLogan Chien <loganchien@google.com>
Fri, 15 Nov 2019 21:40:33 +0000 (13:40 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 15 Nov 2019 21:41:05 +0000 (13:41 -0800)
This commit fixes several attribute dict syntax errors in the documentation.

PiperOrigin-RevId: 280726269

mlir/g3doc/Dialects/GPU.md
mlir/g3doc/Dialects/Standard.md
mlir/g3doc/LangRef.md

index b998320..7d27e15 100644 (file)
@@ -22,7 +22,7 @@ x, y, or z `dimension`.
 Example:
 
 ```mlir {.mlir}
-  %bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index)
+  %bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index)
 ```
 
 ### `gpu.block_id`
@@ -33,7 +33,7 @@ the x, y, or z `dimension`.
 Example:
 
 ```mlir {.mlir}
-  %bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index)
+  %bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index)
 ```
 
 ### `gpu.grid_dim`
@@ -44,7 +44,7 @@ Returns the number of thread blocks in the grid along the x, y, or z
 Example:
 
 ```mlir {.mlir}
-  %gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index)
+  %gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index)
 ```
 
 ### `gpu.launch`
@@ -148,25 +148,25 @@ module attributes {gpu.container_module} {
   // This module creates a separate compilation unit for the GPU compiler.
   module @kernels attributes {gpu.kernel_module} {
     func @kernel_1(%arg0 : f32, %arg1 : !llvm<"float*">)
-        attributes { nvvm.kernel: true } {
+        attributes { nvvm.kernel = true } {
 
       // Operations that produce block/thread IDs and dimensions are injected when
       // outlining the `gpu.launch` body to a function called by `gpu.launch_func`.
-      %tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index)
-      %tIdY = "gpu.thread_id"() {dimension: "y"} : () -> (index)
-      %tIdZ = "gpu.thread_id"() {dimension: "z"} : () -> (index)
+      %tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
+      %tIdY = "gpu.thread_id"() {dimension = "y"} : () -> (index)
+      %tIdZ = "gpu.thread_id"() {dimension = "z"} : () -> (index)
 
-      %bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index)
-      %bDimY = "gpu.block_dim"() {dimension: "y"} : () -> (index)
-      %bDimZ = "gpu.block_dim"() {dimension: "z"} : () -> (index)
+      %bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index)
+      %bDimY = "gpu.block_dim"() {dimension = "y"} : () -> (index)
+      %bDimZ = "gpu.block_dim"() {dimension = "z"} : () -> (index)
 
-      %bIdX = "gpu.block_id"() {dimension: "x"} : () -> (index)
-      %bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index)
-      %bIdZ = "gpu.block_id"() {dimension: "z"} : () -> (index)
+      %bIdX = "gpu.block_id"() {dimension = "x"} : () -> (index)
+      %bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index)
+      %bIdZ = "gpu.block_id"() {dimension = "z"} : () -> (index)
 
-      %gDimX = "gpu.grid_dim"() {dimension: "x"} : () -> (index)
-      %gDimY = "gpu.grid_dim"() {dimension: "y"} : () -> (index)
-      %gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index)
+      %gDimX = "gpu.grid_dim"() {dimension = "x"} : () -> (index)
+      %gDimY = "gpu.grid_dim"() {dimension = "y"} : () -> (index)
+      %gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index)
 
       "some_op"(%bx, %tx) : (index, index) -> ()
       %42 = load %arg1[%bx] : memref<?xf32, 1>
@@ -190,7 +190,7 @@ along the x, y, or z `dimension`.
 Example:
 
 ```mlir {.mlir}
-  %tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index)
+  %tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
 ```
 
 ### `gpu.yield`
index 7533ccc..ed650a5 100644 (file)
@@ -147,8 +147,8 @@ Examples:
 %y = dim %A, 1 : tensor<4 x ? x f32>
 
 // Equivalent generic form:
-%x = "std.dim"(%A){index: 0} : (tensor<4 x ? x f32>) -> index
-%y = "std.dim"(%A){index: 1} : (tensor<4 x ? x f32>) -> index
+%x = "std.dim"(%A) {index = 0 : i64} : (tensor<4 x ? x f32>) -> index
+%y = "std.dim"(%A) {index = 1 : i64} : (tensor<4 x ? x f32>) -> index
 ```
 
 ## Memory Operations
@@ -583,13 +583,13 @@ Examples:
 %x = cmpi "slt", %lhs, %rhs : i32
 
 // Generic form of the same operation.
-%x = "std.cmpi"(%lhs, %rhs){predicate: 2} : (i32, i32) -> i1
+%x = "std.cmpi"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1
 
 // Custom form of vector equality comparison.
 %x = cmpi "eq", %lhs, %rhs : vector<4xi64>
 
 // Generic form of the same operation.
-%x = "std.cmpi"(%lhs, %rhs){predicate: 0}
+%x = "std.cmpi"(%lhs, %rhs) {predicate = 0 : i64}
     : (vector<4xi64>, vector<4xi64>) -> vector<4xi1>
 ```
 
@@ -664,9 +664,9 @@ Examples:
 %3 = constant @myfn : (tensor<16xf32>, f32) -> tensor<16xf32>
 
 // Equivalent generic forms
-%1 = "std.constant"(){value: 42} : i32
-%3 = "std.constant"(){value: @myfn}
-   : () -> (tensor<16xf32>, f32) -> tensor<16xf32>
+%1 = "std.constant"() {value = 42 : i32} : () -> i32
+%3 = "std.constant"() {value = @myfn}
+   : () -> ((tensor<16xf32>, f32) -> tensor<16xf32>)
 
 ```
 
index 21fa8f8..b910446 100644 (file)
@@ -1422,8 +1422,8 @@ either is the self/context or it isn't.
 
 ```mlir {.mlir}
 // A unit attribute defined with the `unit` value specifier.
-func @verbose_form(i1 {unitAttr : unit})
+func @verbose_form(i1) attributes {unitAttr = unit}
 
 // A unit attribute can also be defined without the value specifier.
-func @simple_form(i1 {unitAttr})
+func @simple_form(i1) attributes {unitAttr}
 ```