diff options
author | Brad King <brad.king@kitware.com> | 2022-03-02 12:52:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-03-02 12:52:17 (GMT) |
commit | 04a7200c7561509a83c34f2af45b2d091ae59248 (patch) | |
tree | ad51e5ff4b9fb3ba5c66965b89cc3a3c455bef42 /Source | |
parent | f0f4390325aaf627fe100f9c53afb9087f68cbd1 (diff) | |
parent | 2796d6eeca3d2507f12bc10db82a945a773419a2 (diff) | |
download | CMake-04a7200c7561509a83c34f2af45b2d091ae59248.zip CMake-04a7200c7561509a83c34f2af45b2d091ae59248.tar.gz CMake-04a7200c7561509a83c34f2af45b2d091ae59248.tar.bz2 |
Merge topic 'cuda-arch-all' into release-3.23
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')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index afcac5c..63cf2ec 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3447,22 +3447,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 |