Fix wrong MSVC version constraint for CUDA 9.2 (#40794) (#40849)

Summary:
Tested with https://github.com/pytorch/pytorch/pull/40782.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40794

Differential Revision: D22318045

Pulled By: malfet

fbshipit-source-id: a737ffd7cb8a6a9efb62b84378318f4c3800ad8f
This commit is contained in:
peterjc123 2020-07-01 23:37:40 +08:00 committed by GitHub
parent 415e499330
commit bf4d905ea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -404,15 +404,15 @@ if((CUDA_VERSION VERSION_EQUAL 9.0) OR
endif()
elseif(CUDA_VERSION VERSION_EQUAL 9.2)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.13 AND
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.14 AND
NOT DEFINED ENV{CUDAHOSTCXX})
message(FATAL_ERROR
"CUDA ${CUDA_VERSION} is not compatible with MSVC toolchain version "
">= 19.13. (a.k.a Visual Studio 2017 Update 7, VS 15.7) "
">= 19.14. (a.k.a Visual Studio 2017 Update 7, VS 15.7) "
"Please upgrade to CUDA >= 10.0 or set the following environment "
"variable to use another version (for example): \n"
" set \"CUDAHOSTCXX=C:\\Program Files (x86)\\Microsoft Visual Studio"
"\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX64\\x64\\cl.exe\"\n")
"\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.13.26132\\bin\\HostX64\\x64\\cl.exe\"\n")
endif()
elseif(CUDA_VERSION VERSION_EQUAL 10.0)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND