mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
set USE_STATIC_DISPATCH outside cmake (#29715)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/29715 Previous we hard code it to enable static dispatch when building mobile library. Since we are exploring approaches to deprecate static dispatch we should make it optional. This PR moved the setting from cmake to bash build scripts which can be overridden. Test Plan: - verified it's still using static dispatch when building with these scripts. Differential Revision: D18474640 Pulled By: ljk53 fbshipit-source-id: 7591acc22009bfba36302e3b2a330b1428d8e3f1
This commit is contained in:
parent
60a33cac2b
commit
9371b31818
|
|
@ -317,7 +317,6 @@ if (INTERN_BUILD_MOBILE AND NOT BUILD_CAFFE2_MOBILE)
|
|||
set(USE_FBGEMM OFF)
|
||||
set(USE_PYTORCH_QNNPACK ON)
|
||||
set(USE_QNNPACK OFF)
|
||||
set(USE_STATIC_DISPATCH ON)
|
||||
set(INTERN_DISABLE_ONNX ON)
|
||||
set(INTERN_DISABLE_AUTOGRAD ON)
|
||||
set(INTERN_USE_EIGEN_BLAS ON)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ CMAKE_ARGS=()
|
|||
|
||||
if [ -n "${BUILD_PYTORCH_MOBILE:-}" ]; then
|
||||
CMAKE_ARGS+=("-DBUILD_CAFFE2_MOBILE=OFF")
|
||||
CMAKE_ARGS+=("-DUSE_STATIC_DISPATCH=ON")
|
||||
CMAKE_ARGS+=("-DCMAKE_PREFIX_PATH=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')")
|
||||
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')")
|
||||
CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=OFF")
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ CMAKE_ARGS=()
|
|||
|
||||
if [ -n "${BUILD_PYTORCH_MOBILE:-}" ]; then
|
||||
CMAKE_ARGS+=("-DBUILD_CAFFE2_MOBILE=OFF")
|
||||
CMAKE_ARGS+=("-DUSE_STATIC_DISPATCH=ON")
|
||||
CMAKE_ARGS+=("-DCMAKE_PREFIX_PATH=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')")
|
||||
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')")
|
||||
CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=OFF")
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ cd $BUILD_ROOT
|
|||
|
||||
CMAKE_ARGS=()
|
||||
CMAKE_ARGS+=("-DBUILD_CAFFE2_MOBILE=OFF")
|
||||
CMAKE_ARGS+=("-DUSE_STATIC_DISPATCH=ON")
|
||||
CMAKE_ARGS+=("-DCMAKE_PREFIX_PATH=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')")
|
||||
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=$(python -c 'import sys; print(sys.executable)')")
|
||||
CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=OFF")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user