================
@@ -136,6 +154,51 @@ class OpenACCClauseCIREmitter final
       if (!clause.getArchitectures().empty())
         operation.setDeviceType(
             
decodeDeviceType(clause.getArchitectures()[0].getIdentifierInfo()));
+    } else if constexpr (isOneOfTypes<OpTy, ParallelOp, SerialOp, KernelsOp>) {
+      // Nothing to do here, these constructs don't have any IR for these, as
+      // they just modify the other clauses IR.  So setting of `lastDeviceType`
+      // (done above) is all we need.
+    } else {
+      return clauseNotImplemented(clause);
+    }
+  }
+
+  void VisitNumWorkersClause(const OpenACCNumWorkersClause &clause) {
+    if constexpr (isOneOfTypes<OpTy, ParallelOp, KernelsOp>) {
+      // Collect the 'existing' device-type attributes so we can re-create them
+      // and insert them.
+      llvm::SmallVector<mlir::Attribute> deviceTypes;
+      mlir::ArrayAttr existingDeviceTypes =
+          operation.getNumWorkersDeviceTypeAttr();
+
+      if (existingDeviceTypes) {
+        for (const mlir::Attribute &Attr : existingDeviceTypes)
----------------
erichkeane wrote:

Yeah, you're probably right.  I'll fix this here and 1 other place.

https://github.com/llvm/llvm-project/pull/136578
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [clang] [... Erich Keane via cfe-commits
    • [cla... via cfe-commits
    • [cla... via cfe-commits
    • [cla... Bruno Cardoso Lopes via cfe-commits
    • [cla... Bruno Cardoso Lopes via cfe-commits
    • [cla... Bruno Cardoso Lopes via cfe-commits
    • [cla... Erich Keane via cfe-commits
    • [cla... Erich Keane via cfe-commits
    • [cla... Valentin Clement バレンタイン クレメン via cfe-commits
    • [cla... Erich Keane via cfe-commits
    • [cla... Andy Kaylor via cfe-commits
    • [cla... Andy Kaylor via cfe-commits
    • [cla... Andy Kaylor via cfe-commits
    • [cla... Andy Kaylor via cfe-commits
    • [cla... Erich Keane via cfe-commits
    • [cla... Erich Keane via cfe-commits

Reply via email to