[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 05:52:33 PST 2024


================
@@ -2903,7 +2903,10 @@ TargetOMPContext::TargetOMPContext(
     const FunctionDecl *CurrentFunctionDecl,
     ArrayRef<llvm::omp::TraitProperty> ConstructTraits)
     : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
-                 ASTCtx.getTargetInfo().getTriple()),
+                 ASTCtx.getTargetInfo().getTriple(),
+                 ASTCtx.getLangOpts().OMPTargetTriples.empty()
+                     ? llvm::Triple()
+                     : ASTCtx.getLangOpts().OMPTargetTriples[0]),
----------------
Ritanya-B-Bharadwaj wrote:

>From what I understand, the --offload-arch option is mostly for non-host devices like GPUs and doesn’t apply to the host. For the host, the architecture is determined by the default target triple. Since the host isn’t treated as an offloading target, --offload-arch doesn’t affect its code generation.

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


More information about the llvm-commits mailing list