[PATCH] D151359: [CUDA] Relax restrictions on variadics in host-side compilation.

2023-05-25 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0ad5d40fa19f: [CUDA] Relax restrictions on variadics in 
host-side compilation. (authored by tra).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151359

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


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4677,6 +4677,13 @@
   CmdArgs.push_back(Args.MakeArgString(
   Twine("-target-sdk-version=") +
   CudaVersionToString(CTC->CudaInstallation.version(;
+// 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 (CTC->CudaInstallation.version() >= CudaVersion::CUDA_90)
+  CmdArgs.push_back("-fcuda-allow-variadic-functions");
   }
 }
 CmdArgs.push_back("-aux-triple");


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4677,6 +4677,13 @@
   CmdArgs.push_back(Args.MakeArgString(
   Twine("-target-sdk-version=") +
   CudaVersionToString(CTC->CudaInstallation.version(;
+// 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 (CTC->CudaInstallation.version() >= CudaVersion::CUDA_90)
+  CmdArgs.push_back("-fcuda-allow-variadic-functions");
   }
 }
 CmdArgs.push_back("-aux-triple");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D151359: [CUDA] Relax restrictions on variadics in host-side compilation.

2023-05-24 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision.
Herald added subscribers: mattd, bixia, yaxunl.
Herald added a project: All.
tra published this revision for review.
tra added a reviewer: jlebar.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

D150718  allows variadics during GPU 
compilation, but we also need to do it for
the host compilation as well, as it will see the same code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151359

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


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4677,6 +4677,13 @@
   CmdArgs.push_back(Args.MakeArgString(
   Twine("-target-sdk-version=") +
   CudaVersionToString(CTC->CudaInstallation.version(;
+// 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 (CTC->CudaInstallation.version() >= CudaVersion::CUDA_90)
+  CmdArgs.push_back("-fcuda-allow-variadic-functions");
   }
 }
 CmdArgs.push_back("-aux-triple");


Index: clang/lib/Driver/ToolChains/Clang.cpp
===
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4677,6 +4677,13 @@
   CmdArgs.push_back(Args.MakeArgString(
   Twine("-target-sdk-version=") +
   CudaVersionToString(CTC->CudaInstallation.version(;
+// 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 (CTC->CudaInstallation.version() >= CudaVersion::CUDA_90)
+  CmdArgs.push_back("-fcuda-allow-variadic-functions");
   }
 }
 CmdArgs.push_back("-aux-triple");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits