From fa12a3ab4bd8cd7fa13795123d673d8c512b3b7d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 16 Nov 2023 15:54:30 -0800 Subject: [PATCH] Disable per-session thread pool for web --- onnxruntime/core/framework/session_options.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/onnxruntime/core/framework/session_options.h b/onnxruntime/core/framework/session_options.h index 8deeb4c2b8b64..bb61b275f068d 100644 --- a/onnxruntime/core/framework/session_options.h +++ b/onnxruntime/core/framework/session_options.h @@ -111,7 +111,11 @@ struct SessionOptions { // By default the session uses its own set of threadpools, unless this is set to false. // Use this in conjunction with the CreateEnvWithGlobalThreadPools API. +#if defined(__wasm__) + bool use_per_session_threads = false; +#else bool use_per_session_threads = true; +#endif bool thread_pool_allow_spinning = true; // Deterministic compute is likely not as performant. This option is default to false.