fix nccl compilation to make sure it compiles for architectures that pytorch compiles...
authorSoumith Chintala <soumith@gmail.com>
Tue, 2 Apr 2019 00:07:08 +0000 (17:07 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Apr 2019 00:10:42 +0000 (17:10 -0700)
Summary:
cc: t-vi gchanan zou3519

This fixes https://github.com/pytorch/pytorch/issues/18359
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18704

Differential Revision: D14717015

Pulled By: soumith

fbshipit-source-id: 4aac036f57e564b05d759662e8ad7a80170901c0

cmake/External/nccl.cmake

index 47c6027..56fdbd5 100644 (file)
@@ -20,8 +20,8 @@ if (NOT __NCCL_INCLUDED)
       endif()
     endif()
   else()
+    torch_cuda_get_nvcc_gencode_flag(NVCC_GENCODE)
     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}")