浏览代码

Merge topic 'cuda-archs' into release-3.23

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 年之前
父节点
当前提交
2e963c41b4
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      Source/cmGeneratorTarget.cxx

+ 3 - 5
Source/cmGeneratorTarget.cxx

@@ -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") {