[PATCH] D150718: [CUDA] Relax restrictions on GPU-side variadic functions

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 12:51:23 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa825f3754b3c: [CUDA] Relax restrictions on GPU-side variadic functions (authored by tra).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150718

Files:
  clang/lib/Driver/ToolChains/Cuda.cpp


Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -800,6 +800,13 @@
     if (DriverArgs.hasFlag(options::OPT_fcuda_approx_transcendentals,
                            options::OPT_fno_cuda_approx_transcendentals, false))
       CC1Args.push_back("-fcuda-approx-transcendentals");
+
+    // Unsized function arguments used for variadics were introduced in CUDA-9.0
+    // We still do not support generating code that actually uses variadic
+    // arguments yet, but we do need to allow parsing them as recent CUDA
+    // headers rely on that. https://github.com/llvm/llvm-project/issues/58410
+    if (CudaInstallation.version() >= CudaVersion::CUDA_90)
+      CC1Args.push_back("-fcuda-allow-variadic-functions");
   }
 
   if (DriverArgs.hasArg(options::OPT_nogpulib))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150718.523142.patch
Type: text/x-patch
Size: 920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230517/e9dbd108/attachment-0001.bin>


More information about the cfe-commits mailing list