[PATCH] D120272: [CUDA] Add driver support for compiling CUDA with the new driver

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 22 10:21:11 PDT 2022


tra added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6223-6224
   if (IsCuda || IsHIP) {
-    if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false))
+    if (Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false) ||
+        Args.hasArg(options::OPT_foffload_new_driver))
       CmdArgs.push_back("-fgpu-rdc");
----------------
If user specifies both `-fno-gpu-rdc` and `-foffload-new-driver` we would still enable RDC compilation.
We may want to at least issue a warning. 

Considering that  we have multiple places where we may check for `-f[no]gpu-rdc` we should make sure we don't get different ideas whether RDC has been enabled.
I think it may make sense to provide a common way to figure it out. Either via a helper function that would process CLI arguments or calculate it once and save it somewhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120272/new/

https://reviews.llvm.org/D120272



More information about the cfe-commits mailing list