summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-02 12:52:11 +0000
committerKitware Robot <kwrobot@kitware.com>2022-03-02 07:52:18 -0500
commitcd6341b54796063bb238e93f00f7c3627d5dae32 (patch)
tree32c17d7add1407d0e198191fe5462a009cc645c1 /Source/cmGeneratorTarget.cxx
parent63a461d8181bf79eaf15975b940a028817e4472e (diff)
parent2796d6eeca3d2507f12bc10db82a945a773419a2 (diff)
downloadcmake-cd6341b54796063bb238e93f00f7c3627d5dae32.tar.gz
Merge topic 'cuda-arch-all'
2796d6eeca CUDA: Fix CMAKE_CUDA_ARCHITECTURES=all/all-major with NVCC 11.5+ e450d55552 Help: Update CUDA_ARCHITECTURES docs for generic all/all-major support fe64c49e72 CUDA: Simplify CMAKE_CUDA_ARCHITECTURES special value logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7026
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index e893b4486d..8a6cc1c3b8 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3451,22 +3451,22 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID");
// Check for special modes: `all`, `all-major`.
- if (compiler == "NVIDIA" &&
- cmSystemTools::VersionCompare(
- cmSystemTools::OP_GREATER_EQUAL,
- this->Makefile->GetDefinition("CMAKE_CUDA_COMPILER_VERSION"),
- "11.5")) {
- if (property == "all" || property == "all-major") {
+ if (property == "all" || property == "all-major") {
+ if (compiler == "NVIDIA" &&
+ cmSystemTools::VersionCompare(
+ cmSystemTools::OP_GREATER_EQUAL,
+ this->Makefile->GetDefinition("CMAKE_CUDA_COMPILER_VERSION"),
+ "11.5")) {
flags = cmStrCat(flags, " -arch=", property);
return;
}
- }
-
- if (property == "all") {
- property = *this->Makefile->GetDefinition("CMAKE_CUDA_ARCHITECTURES_ALL");
- } else if (property == "all-major") {
- property =
- *this->Makefile->GetDefinition("CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR");
+ if (property == "all") {
+ property =
+ *this->Makefile->GetDefinition("CMAKE_CUDA_ARCHITECTURES_ALL");
+ } else if (property == "all-major") {
+ property =
+ *this->Makefile->GetDefinition("CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR");
+ }
}
struct CudaArchitecture