[clang] [OpenACC][CIR] Implement 'device_type' clause lowering for 'init'/'sh… (PR #135102)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 9 18:06:19 PDT 2025


================
@@ -4,4 +4,17 @@ void acc_init(void) {
   // CHECK: cir.func @acc_init() {
 #pragma acc init
 // CHECK-NEXT: acc.init loc(#{{[a-zA-Z0-9]+}}){{$}}
+
+#pragma acc init device_type(*)
----------------
erichkeane wrote:

This will faithfully represent them, like this:
```
  // CHECK-NEXT: acc.init attributes {device_types = [#acc.device_type<star>, #acc.device_type<nvidia>]}
```

There isn't really anything that prohibits it by standard, so it seems reasonable to do.

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


More information about the cfe-commits mailing list