[PATCH] D110596: [CUDA] Move CUDA SDK include path further down the include search path.
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 27 15:45:43 PDT 2021
tra updated this revision to Diff 375425.
tra edited the summary of this revision.
tra added a comment.
Fixed the failing test affected by the search path changes.
Disabled addition of CUDA include path if -nogpuinc is in effect.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110596/new/
https://reviews.llvm.org/D110596
Files:
clang/lib/Driver/ToolChains/Cuda.cpp
clang/test/Driver/cuda-detect.cu
Index: clang/test/Driver/cuda-detect.cu
===================================================================
--- clang/test/Driver/cuda-detect.cu
+++ clang/test/Driver/cuda-detect.cu
@@ -179,10 +179,10 @@
// LIBDEVICE50-SAME: libdevice.compute_50.10.bc
// PTX42-SAME: "-target-feature" "+ptx42"
// PTX60-SAME: "-target-feature" "+ptx60"
-// CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA{{[_0-9]+}}/usr/local/cuda/include"
-// NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include"
// CUDAINC-SAME: "-include" "__clang_cuda_runtime_wrapper.h"
// NOCUDAINC-NOT: "-include" "__clang_cuda_runtime_wrapper.h"
+// CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA{{[_0-9]+}}/usr/local/cuda/include"
+// NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include"
// -internal-externc-isystem flags must come *after* the cuda include flags,
// because we must search the cuda include directory first.
// CUDAINC-SAME: "-internal-externc-isystem"
Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -299,8 +299,6 @@
return;
}
- CC1Args.push_back("-internal-isystem");
- CC1Args.push_back(DriverArgs.MakeArgString(getIncludePath()));
CC1Args.push_back("-include");
CC1Args.push_back("__clang_cuda_runtime_wrapper.h");
}
@@ -867,6 +865,11 @@
void CudaToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {
HostTC.AddClangSystemIncludeArgs(DriverArgs, CC1Args);
+
+ if (!DriverArgs.hasArg(options::OPT_nogpuinc) && CudaInstallation.isValid())
+ CC1Args.append(
+ {"-internal-isystem",
+ DriverArgs.MakeArgString(CudaInstallation.getIncludePath())});
}
void CudaToolChain::AddClangCXXStdlibIncludeArgs(const ArgList &Args,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110596.375425.patch
Type: text/x-patch
Size: 1908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210927/f744ca23/attachment.bin>
More information about the cfe-commits
mailing list