[clang] [CUDA] Include PTX in non-RDC mode using the new driver (PR #84367)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 14:41:15 PST 2024


================
@@ -503,18 +503,20 @@ void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
       Exec, CmdArgs, Inputs, Output));
 }
 
-static bool shouldIncludePTX(const ArgList &Args, const char *gpu_arch) {
-  bool includePTX = true;
-  for (Arg *A : Args) {
-    if (!(A->getOption().matches(options::OPT_cuda_include_ptx_EQ) ||
-          A->getOption().matches(options::OPT_no_cuda_include_ptx_EQ)))
-      continue;
+static bool shouldIncludePTX(const ArgList &Args, StringRef InputArch) {
+  // The new driver does not include PTX by default.
+  bool includePTX = !Args.hasFlag(options::OPT_offload_new_driver,
----------------
Artem-B wrote:

I'd add a comment on why we're making this decision based on the new vs old driver.

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


More information about the cfe-commits mailing list