Example:
```mlir {.mlir}
- %bDimX = "gpu.block_dim"() {dimension: "x"} : () -> (index)
+ %bDimX = "gpu.block_dim"() {dimension = "x"} : () -> (index)
```
### `gpu.block_id`
Example:
```mlir {.mlir}
- %bIdY = "gpu.block_id"() {dimension: "y"} : () -> (index)
+ %bIdY = "gpu.block_id"() {dimension = "y"} : () -> (index)
```
### `gpu.grid_dim`
Example:
```mlir {.mlir}
- %gDimZ = "gpu.grid_dim"() {dimension: "z"} : () -> (index)
+ %gDimZ = "gpu.grid_dim"() {dimension = "z"} : () -> (index)
```
### `gpu.launch`
// 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>
Example:
```mlir {.mlir}
- %tIdX = "gpu.thread_id"() {dimension: "x"} : () -> (index)
+ %tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
```
### `gpu.yield`
%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
%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>
```
%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>)
```