interface WebAssemblyFlags {
    initTimeout?: number;
    numThreads?: number;
    proxy?: boolean;
    simd?: boolean | "fixed" | "relaxed";
    trace?: boolean;
    wasmBinary?: ArrayBufferLike | Uint8Array;
    wasmPaths?: WasmPrefixOrFilePaths;
}

Properties

initTimeout?: number

Set or get a number specifying the timeout for initialization of WebAssembly backend, in milliseconds. A zero value indicates no timeout is set.

Default Value

0

numThreads?: number

set or get number of thread(s). If omitted or set to 0, number of thread(s) will be determined by system. If set to 1, no worker thread will be spawned.

This setting is available only when WebAssembly multithread feature is available in current context.

Default Value

0

proxy?: boolean

Set or get a boolean value indicating whether to proxy the execution of main thread to a worker thread.

Default Value

false

simd?: boolean | "fixed" | "relaxed"

set a value indicating whether to enable SIMD.

ONNX Runtime will perform feature detection based on the value of this property. Specifically, when the value is set to:

  • undefined, true or "fixed": will check availability of Fixed-width SIMD.
  • "relaxed": will check availability of Relaxed SIMD.
  • false: will not perform SIMD feature checking.

Setting this property does not make ONNX Runtime to switch to the corresponding runtime automatically. User need to set wasmPaths or wasmBinary property to load the corresponding runtime.

This setting is available only when WebAssembly SIMD feature is available in current context.

Default Value

true

trace?: boolean

set or get a boolean value indicating whether to enable trace.

Default Value

false

Deprecated

Use env.trace instead. If env.trace is set, this property will be ignored.

wasmBinary?: ArrayBufferLike | Uint8Array

Set a custom buffer which contains the WebAssembly binary. If this property is set, the wasmPaths property will be ignored.

Set a custom URL prefix to the .wasm/.mjs files, or an object of overrides for both .wasm/.mjs file. The override path should be an absolute path.

Generated using TypeDoc