Browse Source

Merge topic 'cuda-archs'

f75299b803 CUDA: Restore support for non-"all" CUDA_ARCHITECTURES with nvcc 11.5+

Acked-by: Kitware Robot <[email protected]>
Merge-request: !7007
Brad King 3 years ago
parent
commit
8bbca4ecf9
1 changed files with 3 additions and 5 deletions
  1. 3 5
      Source/cmGeneratorTarget.cxx

+ 3 - 5
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") {