mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-17 21:10:43 +00:00
[js/web] add SharedArrayBuffer check for wasm multi-thread (#8749)
This commit is contained in:
parent
ae6fdd3333
commit
4ceedbe933
1 changed files with 5 additions and 0 deletions
|
|
@ -16,6 +16,11 @@ let aborted = false;
|
|||
|
||||
const isMultiThreadSupported = (): boolean => {
|
||||
try {
|
||||
// If 'SharedArrayBuffer' is not available, WebAssembly threads will not work.
|
||||
if (typeof SharedArrayBuffer === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test for transferability of SABs (for browsers. needed for Firefox)
|
||||
// https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ
|
||||
if (typeof MessageChannel !== 'undefined') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue