Add DONT_VECTORIZE flag to cmake (#12169)

Add DONT_VECTORIZE flag.
This commit is contained in:
Jan Tilly 2022-09-07 04:14:14 +02:00 committed by GitHub
parent 706e03c63d
commit 437409c343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,6 +85,7 @@ option(onnxruntime_TENSORRT_PLACEHOLDER_BUILDER "Instantiate Placeholder TensorR
option(onnxruntime_ENABLE_LTO "Enable link time optimization" OFF)
option(onnxruntime_CROSS_COMPILING "Cross compiling onnx runtime" OFF)
option(onnxruntime_GCOV_COVERAGE "Compile with options necessary to run code coverage" OFF)
option(onnxruntime_DONT_VECTORIZE "Do not vectorize operations in Eigen" OFF)
#It's preferred to turn it OFF when onnxruntime is dynamically linked to PROTOBUF. But Tensort always required the full version of protobuf.
cmake_dependent_option(onnxruntime_USE_FULL_PROTOBUF "Link to libprotobuf instead of libprotobuf-lite when this option is ON" OFF "NOT onnxruntime_USE_TENSORRT" ON)
@ -518,6 +519,10 @@ if (MSVC)
-DEIGEN_STRONG_INLINE=inline)
endif()
if ( onnxruntime_DONT_VECTORIZE )
add_definitions(-DEIGEN_DONT_VECTORIZE=1)
endif()
if (onnxruntime_CROSS_COMPILING)
set(CMAKE_CROSSCOMPILING ON)
check_cxx_compiler_flag(-Wno-error HAS_NOERROR)