diff options
author | Yangqing Jia <jiayq@fb.com> | 2017-03-07 10:56:26 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2017-03-07 11:02:12 -0800 |
commit | 1741fd839f929f9b47e5c86d4e9ef1c5e1a8462d (patch) | |
tree | 3a30c254fe69e586b30815b28eb5ac895d7acdef /cmake/Modules | |
parent | d8588d8007c5e4e07d585c854f7cab8f7f2a3359 (diff) | |
download | pytorch-1741fd839f929f9b47e5c86d4e9ef1c5e1a8462d.tar.gz pytorch-1741fd839f929f9b47e5c86d4e9ef1c5e1a8462d.tar.bz2 pytorch-1741fd839f929f9b47e5c86d4e9ef1c5e1a8462d.zip |
Re-apply windows diff D4657831
Summary:
(Note: previous revert was due to a race condition between D4657831 and
D4659953 that I failed to catch.)
After this, we should have contbuild guarding the Windows build both with
and without CUDA.
This includes a series of changes that are needed to make Windows build,
specifically:
(1) Various flags that are needed in the cmake system, specially dealing
with /MD, /MT, cuda, cudnn, whole static linking, etc.
(2) Contbuild scripts based on appveyo.
(3) For Windows build, note that one will need to use "cmake --build" to
build stuff so that the build type is consistent between configuration and
actual build. see scripts\build_windows.bat for details.
(4) In logging.h, ERROR is already defined by Windows. I don't have a good
solution now, and as a result, LOG(ERROR) on windows is going to be
LOG(INFO).
(5) variable length array is not supported by MSVC (and it is not part of
C++ standard). As a result I replaced them with vectors.
(6) sched.h is not available on Windows, so akyrola 's awesome simple
async net might encounter some slowdown due to no affinity setting on
Windows.
(7) MSVC has a bug that does not work very well with template calls inide
a templated function call, which is a known issue that should be fixed in
MSVC 2017. However for now this means changes to conv_op_impl.h and
recurrent_net_op.h. No actual functionalities are changed.
(8) std host function calls are not supported in CUDA8+MSVC, so I changed
lp_pool (and maybe a few others) to use cuda device functions.
(9) The current Scale and Axpy has heavy templating that does not work
well with MSVC. As a result I reverted azzolini 's changes to the Scale
and Axpy interface, moved the fixed-length version to ScaleFixedSize and
AxpyFixedSize.
(10) CUDA + MSVC does not deal with Eigen well, so I guarded all Eigen
parts to only the non-CUDA part.
(11) In conclusion, it is fun but painful to deal with visual c++.
Differential Revision: D4666745
fbshipit-source-id: 3c9035083067bdb19a16d9c345c1ce66b6a86600
Diffstat (limited to 'cmake/Modules')
-rw-r--r-- | cmake/Modules/FindCuDNN.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/Modules/FindCuDNN.cmake b/cmake/Modules/FindCuDNN.cmake index 3b630f5cbd..1678cd2ba4 100644 --- a/cmake/Modules/FindCuDNN.cmake +++ b/cmake/Modules/FindCuDNN.cmake @@ -14,14 +14,15 @@ include(FindPackageHandleStandardArgs) set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN") find_path(CUDNN_INCLUDE_DIR cudnn.h - PATHS ${CUDNN_ROOT_DIR} + PATHS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR} PATH_SUFFIXES cuda/include include) find_library(CUDNN_LIBRARY cudnn - PATHS ${CUDNN_ROOT_DIR} - PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64) + PATHS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR} + PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64) -find_package_handle_standard_args(CUDNN DEFAULT_MSG CUDNN_INCLUDE_DIR CUDNN_LIBRARY) +find_package_handle_standard_args( + CUDNN DEFAULT_MSG CUDNN_INCLUDE_DIR CUDNN_LIBRARY) if(CUDNN_FOUND) # get cuDNN version |