Disable multiple threads for emscripten single-thread builds in ggml_graph_plan

This commit is contained in:
Reese Levine 2025-11-17 13:53:00 -08:00
parent 5bcd57722f
commit f9ba81953b
1 changed files with 5 additions and 0 deletions

View File

@ -2701,6 +2701,11 @@ struct ggml_cplan ggml_graph_plan(
n_threads = threadpool ? threadpool->n_threads_max : GGML_DEFAULT_N_THREADS;
}
#if defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_PTHREADS__)
// Emscripten without pthreads support can only use a single thread
n_threads = 1;
#endif
size_t work_size = 0;
struct ggml_cplan cplan;