mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Sync FindCUDA.cmake with upstream cmake repo (#11880)
Summary: Upstream PR: https://gitlab.kitware.com/cmake/cmake/merge_requests/2391/diffs Pull Request resolved: https://github.com/pytorch/pytorch/pull/11880 Differential Revision: D9989119 Pulled By: soumith fbshipit-source-id: 66e87367127975a5f1619fe447f74e76f101b503
This commit is contained in:
parent
58d28a5f12
commit
a7afd133f5
|
|
@ -202,7 +202,7 @@ REM The following two lines are needed for Python 2.7, but the support for it is
|
||||||
set MSSdk=1
|
set MSSdk=1
|
||||||
set FORCE_PY27_BUILD=1
|
set FORCE_PY27_BUILD=1
|
||||||
REM As for CUDA 8, VS2015 Update 3 is also required to build PyTorch. Use the following line.
|
REM As for CUDA 8, VS2015 Update 3 is also required to build PyTorch. Use the following line.
|
||||||
set "CUDA_HOST_COMPILER=%VS140COMNTOOLS%\..\..\VC\bin\amd64\cl.exe"
|
set "CUDAHOSTCXX=%VS140COMNTOOLS%\..\..\VC\bin\amd64\cl.exe"
|
||||||
|
|
||||||
call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.11
|
call "%VS150COMNTOOLS%\vcvarsall.bat" x64 -vcvars_ver=14.11
|
||||||
python setup.py install
|
python setup.py install
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@
|
||||||
# the host compiler is constructed with one or more visual studio macros
|
# the host compiler is constructed with one or more visual studio macros
|
||||||
# such as $(VCInstallDir), that expands out to the path when
|
# such as $(VCInstallDir), that expands out to the path when
|
||||||
# the command is run from within VS.
|
# the command is run from within VS.
|
||||||
|
# If the CUDAHOSTCXX environment variable is set it will
|
||||||
|
# be used as the default.
|
||||||
#
|
#
|
||||||
# CUDA_NVCC_FLAGS
|
# CUDA_NVCC_FLAGS
|
||||||
# CUDA_NVCC_FLAGS_<CONFIG>
|
# CUDA_NVCC_FLAGS_<CONFIG>
|
||||||
|
|
@ -531,8 +533,8 @@ option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
|
||||||
# Extra user settable flags
|
# Extra user settable flags
|
||||||
cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.")
|
cmake_initialize_per_config_variable(CUDA_NVCC_FLAGS "Semi-colon delimit multiple arguments.")
|
||||||
|
|
||||||
if(DEFINED ENV{CUDA_HOST_COMPILER})
|
if(DEFINED ENV{CUDAHOSTCXX})
|
||||||
set(CUDA_HOST_COMPILER "$ENV{CUDA_HOST_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC")
|
set(CUDA_HOST_COMPILER "$ENV{CUDAHOSTCXX}" CACHE FILEPATH "Host side compiler used by NVCC")
|
||||||
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")
|
set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")
|
||||||
if(MSVC_VERSION LESS 1910)
|
if(MSVC_VERSION LESS 1910)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user