mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
[js/webgpu] throw error when WebGPU=ON and SIMD=OFF (#15924)
### Description throw error when WebGPU=ON and SIMD=OFF
This commit is contained in:
parent
780442b9f6
commit
04ea561fc8
1 changed files with 4 additions and 0 deletions
|
|
@ -98,6 +98,10 @@ class ComputeContextImpl implements ComputeContext {
|
|||
export const init = async(module: OrtWasmModule, env: Env): Promise<void> => {
|
||||
const init = module.jsepInit;
|
||||
if (init && navigator.gpu) {
|
||||
if (!env.wasm.simd) {
|
||||
throw new Error(
|
||||
'Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using WebGPU EP');
|
||||
}
|
||||
const backend = new WebGpuBackend();
|
||||
await backend.initialize(env);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue