[clang] [CUDA] Add device-side kernel launch support (PR #165519)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 11 05:52:11 PST 2025


================
@@ -497,6 +497,11 @@ Expected<SmallVector<StringRef>> getInput(const ArgList &Args) {
       continue;
     }
 
+    // Skip '-lcudadevrt'.
+    if (Arg->getOption().matches(OPT_library) &&
+        StringRef(Arg->getValue()) == "cudadevrt")
----------------
jhuber6 wrote:

I don't know how CUDA handles these fat binaries exactly, I'm assuming `nvlink` does some magic there. Any option passed to the linker will be forwarded to `nvlink`. I suppose one problem might be the fact that we do LTO and stuff so it might get confused if binaries for another target are in there? Is it really not working if you just pass `-lcudadevrt` to the wrapper?

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


More information about the cfe-commits mailing list