summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-22 17:56:44 +0000
committerKitware Robot <kwrobot@kitware.com>2022-02-22 12:56:51 -0500
commit8bbca4ecf9e872edc96bc43d807e74c4af1d6ea0 (patch)
tree168d029d7dc8b112f6169f3c4ca72eb42fc788b4
parente2587d6f5ef2f7de31dd950d192c7bc5701d1da5 (diff)
parentf75299b80380c13ff29c934c3a5ad35ba5e3da1c (diff)
downloadcmake-8bbca4ecf9e872edc96bc43d807e74c4af1d6ea0.tar.gz
Merge topic 'cuda-archs'
f75299b803 CUDA: Restore support for non-"all" CUDA_ARCHITECTURES with nvcc 11.5+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7007
-rw-r--r--Source/cmGeneratorTarget.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e722fa9c1a..a246c125c9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3456,12 +3456,10 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
cmSystemTools::OP_GREATER_EQUAL,
this->Makefile->GetDefinition("CMAKE_CUDA_COMPILER_VERSION"),
"11.5")) {
- if (property == "all") {
- flags += " -arch=all";
- } else if (property == "all-major") {
- flags += " -arch=all-major";
+ if (property == "all" || property == "all-major") {
+ flags = cmStrCat(flags, " -arch=", property);
+ return;
}
- return;
}
if (property == "all") {