optimize web assembly build flags for multi-thread (#10759)

This commit is contained in:
Yulong Wang 2022-03-03 16:44:14 -08:00 committed by GitHub
parent c8ec7782bd
commit 745fa5885f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -312,7 +312,7 @@ endif()
if (onnxruntime_BUILD_WEBASSEMBLY)
# Enable LTO for release single-thread build
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT onnxruntime_ENABLE_WEBASSEMBLY_THREADS)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# NOTES:
# (1) LTO does not work for WebAssembly multi-thread. (segment fault in worker)
# (2) "-flto=thin" does not work correctly for wasm-ld.

View file

@ -669,15 +669,7 @@ if(WIN32)
endif()
if (onnxruntime_BUILD_WEBASSEMBLY)
if (onnxruntime_ENABLE_WEBASSEMBLY_THREADS)
# WebAssembly threading support in node is an experimental feature yet
# and that makes some intensive threadpool tests fail randomly.
# Will enable this test when node.js releases a stable version supporting multi-threads.
list(REMOVE_ITEM all_tests
"${TEST_SRC_DIR}/platform/threadpool_test.cc"
"${TEST_SRC_DIR}/providers/cpu/nn/string_normalizer_test.cc"
)
else()
if (NOT onnxruntime_ENABLE_WEBASSEMBLY_THREADS)
list(REMOVE_ITEM all_tests
"${TEST_SRC_DIR}/framework/execution_frame_test.cc"
"${TEST_SRC_DIR}/framework/inference_session_test.cc"