summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-18 16:28:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-18 16:29:44 (GMT)
commitb246dee7db2e7e6fcd2a00c5b2bd6db21045025f (patch)
tree7d6c9310a65d91c49e7223de20f8df274ca93e0d /Source
parent4acf31d681ff25543a5d7615521a75ebe368fb24 (diff)
parenta653ca9504569eb45077ee598945b18a3c9e4ee8 (diff)
downloadCMake-b246dee7db2e7e6fcd2a00c5b2bd6db21045025f.zip
CMake-b246dee7db2e7e6fcd2a00c5b2bd6db21045025f.tar.gz
CMake-b246dee7db2e7e6fcd2a00c5b2bd6db21045025f.tar.bz2
Merge topic 'cuda-clang'
a653ca9504 Tests: Update CUDA tests to work with Clang 5df21adf46 CUDA: Add support for Clang compiler dc2eae1f91 FindCUDAToolkit: Factor out discovery code into a separate file 70be10cbf4 CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIA Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artem Belevich <tra@google.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Acked-by: friendnick <ikoval67@gmail.com> Acked-by: Patrik Huber <patrikhuber@gmail.com> Merge-request: !4442
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index fb0512e..335f7a4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3180,6 +3180,20 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
flags += "]";
}
+ } else if (compiler == "Clang") {
+ for (CudaArchitecture& architecture : architectures) {
+ flags += " --cuda-gpu-arch=sm_" + architecture.name;
+
+ if (!architecture.real) {
+ Makefile->IssueMessage(
+ MessageType::WARNING,
+ "Clang doesn't support disabling CUDA real code generation.");
+ }
+
+ if (!architecture.virtual_) {
+ flags += " --no-cuda-include-ptx=sm_" + architecture.name;
+ }
+ }
}
}