From: Soumith Chintala Date: Wed, 3 Apr 2019 19:44:35 +0000 (-0700) Subject: fix nccl compilation to make sure it compiles for architectures that pytorch compiles... X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~443 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8711df89ccd8ef24b14a139a2aa4c61fbd126d46;p=platform%2Fupstream%2Fpytorch.git fix nccl compilation to make sure it compiles for architectures that pytorch compiles for (#18739) 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 --- diff --git a/cmake/External/nccl.cmake b/cmake/External/nccl.cmake index 47c6027..cb20610 100644 --- a/cmake/External/nccl.cmake +++ b/cmake/External/nccl.cmake @@ -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