Skip to content

Commit

Permalink
[js/webgpu] throw error when WebGPU=ON and SIMD=OFF (microsoft#15924)
Browse files Browse the repository at this point in the history
### Description
throw error when WebGPU=ON and SIMD=OFF
  • Loading branch information
fs-eire authored May 16, 2023
1 parent fbb90b7 commit b16c7a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/lib/wasm/jsep/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b16c7a1

Please sign in to comment.