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

Razvan Lupusoru llvmlistbot at llvm.org
Fri Feb 2 12:11:14 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) {
----------------
razvanlupusoru wrote:

I think what I am gathering from your review is that you prefer simpler printing. Namely have:
acc.loop combined(parallel)
and
acc.parallel combined(loop) OR acc.parallel combined
I think this is OK without forcing the underlying attribute to be unit attribute. I also prefer "combined(loop)" instead of just "combined"


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


More information about the Mlir-commits mailing list