diff options
author | Peter Goldsborough <psag@fb.com> | 2018-11-13 16:30:05 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-11-13 16:35:54 -0800 |
commit | 8311bbee7f1dd33346f18c769cfeb8c5b5941874 (patch) | |
tree | 04b777b1ac3dc84a53185657c001a23d2c60c80b /torch/CMakeLists.txt | |
parent | f649d8b3a9145563852721763cd1fb6246a9ad21 (diff) | |
download | pytorch-8311bbee7f1dd33346f18c769cfeb8c5b5941874.tar.gz pytorch-8311bbee7f1dd33346f18c769cfeb8c5b5941874.tar.bz2 pytorch-8311bbee7f1dd33346f18c769cfeb8c5b5941874.zip |
Fix Windows build and test in CI (#11716)
Summary:
This PR adds Windows support for the C++ frontend. A lot of declarations were missing `TORCH_API` macros, and lots of code just did not compile on MSVC.
ebetica ezyang orionr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11716
Reviewed By: orionr
Differential Revision: D13038253
Pulled By: goldsborough
fbshipit-source-id: c8e5a45efd26117aeb99e768b56fcd5a89fcb9f8
Diffstat (limited to 'torch/CMakeLists.txt')
-rw-r--r-- | torch/CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt index dd7bcc9edd..ef32f00c68 100644 --- a/torch/CMakeLists.txt +++ b/torch/CMakeLists.txt @@ -253,7 +253,6 @@ if (NOT NO_API AND NOT USE_ROCM) ${TORCH_SRC_DIR}/csrc/api/src/optim/sgd.cpp ${TORCH_SRC_DIR}/csrc/api/src/serialize/input-archive.cpp ${TORCH_SRC_DIR}/csrc/api/src/serialize/output-archive.cpp - ${TORCH_SRC_DIR}/csrc/api/src/serialize/tensor.cpp ${TORCH_SRC_DIR}/csrc/api/src/utils.cpp ) endif() @@ -344,10 +343,16 @@ endif() if(USE_CUDA) if(MSVC) + if (NOT NVTOOLEXT_HOME) + set(NVTOOLEXT_HOME "C:/Program Files/NVIDIA Corporation/NvToolsExt") + endif() + if ($ENV{NVTOOLEXT_HOME}) + set(NVTOOLEXT_HOME $ENV{NVTOOLEXT_HOME}) + endif() set(TORCH_CUDA_LIBRARIES ${NVTOOLEXT_HOME}/lib/x64/nvToolsExt64_1.lib ${CUDA_LIBRARIES}) - target_include_directories(torch PRIVATE "${NVTOOLEXT_HOME}/include") + target_include_directories(torch PUBLIC "${NVTOOLEXT_HOME}/include") elseif(APPLE) set(TORCH_CUDA_LIBRARIES ${CUDA_TOOLKIT_ROOT_DIR}/lib/libcudart.dylib |