fix nccl compilation to make sure it compiles for architectures that pytorch compiles...
authorSoumith Chintala <soumith@gmail.com>
Wed, 3 Apr 2019 19:44:35 +0000 (12:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 19:52:50 +0000 (12:52 -0700)
Summary:
resubmit of https://github.com/pytorch/pytorch/pull/18704 with additional fixes

Fixes https://github.com/pytorch/pytorch/issues/18359
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18739

Differential Revision: D14737274

Pulled By: soumith

fbshipit-source-id: cfbbbf68b098594bd045861d1b2c085da693ea51

cmake/External/nccl.cmake

index 47c6027..cb20610 100644 (file)
@@ -20,12 +20,10 @@ if (NOT __NCCL_INCLUDED)
       endif()
     endif()
   else()
-    if (TORCH_CUDA_ARCH_LIST)
-      torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE)
-      string(REPLACE "-gencode;" "-gencode=" NVCC_GENCODE "${NVCC_GENCODE}")
-      # this second replacement is needed when there are multiple archs
-      string(REPLACE ";-gencode" " -gencode" NVCC_GENCODE "${NVCC_GENCODE}")
-    endif()
+    torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE)
+    string(REPLACE "-gencode;" "-gencode=" NVCC_GENCODE "${NVCC_GENCODE}")
+    # this second replacement is needed when there are multiple archs
+    string(REPLACE ";-gencode" " -gencode" NVCC_GENCODE "${NVCC_GENCODE}")
 
     ExternalProject_Add(nccl_external
       SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/nccl/nccl