================
@@ -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();
+  }
----------------
jhuber6 wrote:

I don't think this belongs in regular triple handling. It could be a more 
generic 'isTargetGPU` but I think there were some objections given that SPIR-V 
can target other things?

My concern is that this is a `triple` which just handles a single target, while 
the concept of 'offloading' is only relevant with an auxiliary triple. I think 
this is better as a helper in Clang, we could possible even combine all of 
these `isCUDADevice`, `isOpenMPDevice` checks as well.

https://github.com/llvm/llvm-project/pull/126956
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to