mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
enable sse4.1 optimizations for gemmlowp (#1529)
This commit is contained in:
parent
28a6f6b11b
commit
b599360014
1 changed files with 11 additions and 0 deletions
|
|
@ -77,6 +77,17 @@ if(HAS_DEPRECATED_COPY)
|
|||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/tensor/onehot.cc" PROPERTIES COMPILE_FLAGS -Wno-deprecated-copy)
|
||||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/tensor/where_op.cc" PROPERTIES COMPILE_FLAGS -Wno-deprecated-copy)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT MSVC)
|
||||
# For x86 platforms it is important to pass this flag to compiler. Without this gemmlowp will use slow reference code.
|
||||
# These optimizations are not enabled on MSVC so excluding it.
|
||||
message("enabling optimizations for gemmlowp")
|
||||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/math/matmul_integer.cc" PROPERTIES COMPILE_FLAGS "-msse4.1")
|
||||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/math/quantize_linear_matmul.cc" PROPERTIES COMPILE_FLAGS "-msse4.1")
|
||||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/nn/qlinearconv.cc" PROPERTIES COMPILE_FLAGS "-msse4.1")
|
||||
set_source_files_properties("${ONNXRUNTIME_ROOT}/core/providers/cpu/nn/conv_integer.cc" PROPERTIES COMPILE_FLAGS "-msse4.1")
|
||||
endif()
|
||||
|
||||
set(gemmlowp_src ${PROJECT_SOURCE_DIR}/external/gemmlowp)
|
||||
set(re2_src ${ONNXRUNTIME_ROOT}/../cmake/external/re2)
|
||||
target_include_directories(onnxruntime_providers PRIVATE ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} ${gemmlowp_src} ${re2_src})
|
||||
|
|
|
|||
Loading…
Reference in a new issue