Skip to content

Commit 0ad5d40

Browse files
committed
[CUDA] Relax restrictions on variadics in host-side compilation.
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. Differential Revision: https://reviews.llvm.org/D151359
1 parent fe2f0ab commit 0ad5d40

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,6 +4677,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
46774677
CmdArgs.push_back(Args.MakeArgString(
46784678
Twine("-target-sdk-version=") +
46794679
CudaVersionToString(CTC->CudaInstallation.version())));
4680+
// Unsized function arguments used for variadics were introduced in
4681+
// CUDA-9.0. We still do not support generating code that actually uses
4682+
// variadic arguments yet, but we do need to allow parsing them as
4683+
// recent CUDA headers rely on that.
4684+
// https://github.com/llvm/llvm-project/issues/58410
4685+
if (CTC->CudaInstallation.version() >= CudaVersion::CUDA_90)
4686+
CmdArgs.push_back("-fcuda-allow-variadic-functions");
46804687
}
46814688
}
46824689
CmdArgs.push_back("-aux-triple");

0 commit comments

Comments
 (0)