Skip to content

Commit

Permalink
idk what happened
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Nov 28, 2024
1 parent 84a6297 commit 57a3ea8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ if(EMSCRIPTEN)
add_compile_options(-pthread)
# mimalloc is needed for good performance
add_link_options(-sMALLOC=mimalloc)
add_link_options(-sPTHREAD_POOL_SIZE=4)
# The default stack size apparently causes problem when parallelization is
# enabled.
add_link_options(-sSTACK_SIZE=20MB)
add_link_options(-sINITIAL_MEMORY=20MB)
add_link_options(-sSTACK_SIZE=30MB)
add_link_options(-sINITIAL_MEMORY=32MB)
endif()
if(MANIFOLD_DEBUG)
list(APPEND MANIFOLD_FLAGS -fexceptions)
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
export EM_CACHE=$(pwd)/.emscriptencache
mkdir build
cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel \
-DMANIFOLD_PAR=${if parallel then "ON" else "OFF"} \
-DFETCHCONTENT_SOURCE_DIR_GOOGLETEST=${gtest-src} \
-DFETCHCONTENT_SOURCE_DIR_TBB=${onetbb-src} \
Expand Down
3 changes: 0 additions & 3 deletions test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "test.h"

#if (MANIFOLD_PAR == 1)
#include <oneapi/tbb/global_control.h>
#include <oneapi/tbb/parallel_for.h>
#endif

Expand Down Expand Up @@ -54,8 +53,6 @@ int main(int argc, char** argv) {
// https://github.com/oneapi-src/oneTBB/blob/master/WASM_Support.md#limitations
#if defined(__EMSCRIPTEN__) && (MANIFOLD_PAR == 1)
int num_threads = tbb::this_task_arena::max_concurrency();
oneapi::tbb::global_control global_limit(
tbb::global_control::thread_stack_size, 16 * 1024 * 1024);
std::atomic<int> barrier{num_threads};
tbb::parallel_for(
0, num_threads,
Expand Down

0 comments on commit 57a3ea8

Please sign in to comment.