Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ if (EMSCRIPTEN)
-Wuninitialized
-fexceptions
-flto
-pthread
)
target_link_options(sekai_deck_recommend_wasm PRIVATE
-pthread
"-sPTHREAD_POOL_SIZE=4"

--bind
-fexceptions
-flto
Expand Down
10 changes: 7 additions & 3 deletions src/deck-recommend/base-deck-recommend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ void BaseDeckRecommend::runRecommendAlgorithm(
config.target == RecommendTarget::Score
&& Enums::LiveType::isMulti(liveType)
&& config.member == 5;
const int dfsThreads = orderIndependentScore
? std::max(1, config.dfsParallelThreads)
: 1;
#if defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__)
// 单线程 WASM 构建没有线程支持,分区并行退化为串行
const int configuredDfsThreads = 1;
#else
const int configuredDfsThreads = std::max(1, config.dfsParallelThreads);
#endif
Comment on lines +185 to +190
const int dfsThreads = orderIndependentScore ? configuredDfsThreads : 1;
if (dfsThreads <= 1) {
findBestCardsDFS(
liveType, config, dfsCards, supportCards, scoreFunc,
Expand Down
Loading