Add an option to statically link cuda (#10596)

Summary:
Need to link CUDA statically for benchmarking purpose.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10596

Reviewed By: llyfacebook

Differential Revision: D9370738

Pulled By: sf-wind

fbshipit-source-id: 4464d62473e95fe8db65b0bd3b301f262bf269bf
This commit is contained in:
Fei Sun 2018-09-11 10:59:03 -07:00 committed by Facebook Github Bot
parent 727a4453aa
commit d09041bd81

View File

@ -10,6 +10,10 @@ setlocal
SET ORIGINAL_DIR=%cd%
SET CAFFE2_ROOT=%~dp0%..
if NOT DEFINED CAFFE2_STATIC_LINK_CUDA (
set CAFFE2_STATIC_LINK_CUDA=OFF
)
if NOT DEFINED CMAKE_BUILD_TYPE (
set CMAKE_BUILD_TYPE=Release
)
@ -57,6 +61,7 @@ cmake .. ^
-G%CMAKE_GENERATOR% ^
-DBUILD_TEST=OFF ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DCAFFE2_STATIC_LINK_CUDA=%CAFFE2_STATIC_LINK_CUDA% ^
-DUSE_CUDA=%USE_CUDA% ^
-DTORCH_CUDA_ARCH_LIST=5.0 ^
-DUSE_NNPACK=OFF ^