diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2018-04-04 23:26:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 23:26:57 -0400 |
commit | 73ab15d3884ecbf74c6411fbc7288d08de5e2a39 (patch) | |
tree | f57125012c9de6a2e699e1a37e94f9d2efd1e43a /cmake | |
parent | efc91d8c6dbf9d3aa598a58ac17921354acec2af (diff) | |
download | pytorch-73ab15d3884ecbf74c6411fbc7288d08de5e2a39.tar.gz pytorch-73ab15d3884ecbf74c6411fbc7288d08de5e2a39.tar.bz2 pytorch-73ab15d3884ecbf74c6411fbc7288d08de5e2a39.zip |
Change ATen to use Caffe2/cmake upstream FindCUDA (#6240)
* Remove ATen's copy of FindCUDA
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* Minor bugfix for updated FindCUDA.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* Use cl.exe as the host compiler even when clcache.exe is set.
Upstream merge request at https://gitlab.kitware.com/cmake/cmake/merge_requests/1933
H/t peterjc123 who contributed the original version of this patch.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* Include CMakeInitializeConfigs polyfill from ATen.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
* Tweak the regex so it actually works on Windows.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules_CUDA_fix/FindCUDA.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/Modules_CUDA_fix/FindCUDA.cmake b/cmake/Modules_CUDA_fix/FindCUDA.cmake index 6f6f349715..d4f296243b 100644 --- a/cmake/Modules_CUDA_fix/FindCUDA.cmake +++ b/cmake/Modules_CUDA_fix/FindCUDA.cmake @@ -557,6 +557,13 @@ else() set(c_compiler_realpath "") endif() set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC") + elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache") + # NVCC does not think it will work if it is passed clcache.exe as the host + # compiler, which means that builds with CC=cl.exe won't work. Best to just + # feed it whatever the actual cl.exe is as the host compiler. + # + # FYI: clcache works as the match, but clcache.exe does NOT. + set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC") else() set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "Host side compiler used by NVCC") |