[clang] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 5 13:10:15 PST 2025


================
@@ -1109,6 +1109,11 @@ class Triple {
            Env == llvm::Triple::EABIHF;
   }
 
+  /// Tests if the target represents a device which can be offloaded to.
+  bool isOffloadingTarget() const {
+    return isAMDGPU() || isNVPTX() || isSPIRV();
+  }
----------------
sarnex wrote:

Maybe something like the latest commit is closer to what you had in mind?

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


More information about the cfe-commits mailing list