mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-21 03:10:46 -05:00
CUDA: Restore support for non-"all" CUDA_ARCHITECTURES with nvcc 11.5+
Since commit 8f64df0a7c (CUDA: Generic all and all-major support,
2021-12-19, v3.23.0-rc1~23^2), setting `CUDA_ARCHITECTURES` to a value
other than `all` or `all-major` is ignored with NVCC 11.5+. Fix the
logic to return early only when actually using an "all" value.
Fixes: #23243
This commit is contained in:
@@ -3452,12 +3452,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") {
|
||||
|
||||
Reference in New Issue
Block a user