[Mlir-commits] [mlir] [acc] Add attribute for combined constructs (PR #80319)

Valentin Clement バレンタイン クレメン llvmlistbot at llvm.org
Thu Feb 1 11:50:50 PST 2024


================
@@ -1846,9 +1846,49 @@ func.func @acc_atomic_capture(%v: memref<i32>, %x: memref<i32>, %expr: i32) {
 
 // -----
 
-%c2 = arith.constant 2 : i32
-%c1 = arith.constant 1 : i32
-acc.parallel num_gangs({%c2 : i32} [#acc.device_type<default>], {%c1 : i32, %c1 : i32, %c1 : i32} [#acc.device_type<nvidia>]) {
+// CHECK-LABEL: func.func @acc_num_gangs
+func.func @acc_num_gangs() {
+  %c2 = arith.constant 2 : i32
+  %c1 = arith.constant 1 : i32
+  acc.parallel num_gangs({%c2 : i32} [#acc.device_type<default>], {%c1 : i32, %c1 : i32, %c1 : i32} [#acc.device_type<nvidia>]) {
+  }
+
+  return
 }
 
 // CHECK: acc.parallel num_gangs({%c2{{.*}} : i32} [#acc.device_type<default>], {%c1{{.*}} : i32, %c1{{.*}} : i32, %c1{{.*}} : i32} [#acc.device_type<nvidia>])
+
+// -----
+
+// CHECK-LABEL: func.func @acc_combined
+func.func @acc_combined() {
+  acc.parallel combined(parallel loop) {
+    acc.loop combined(parallel loop) {
----------------
clementval wrote:

I would also simply the IR on the loop operation and just print the name of the op it is combined with. duplicate `loop` looks verbose. 
```suggestion
    acc.loop combined(parallel) {
```

https://github.com/llvm/llvm-project/pull/80319


More information about the Mlir-commits mailing list