mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[js/webgpu] only register webgpu backend when it's available (#15922)
### Description only register webgpu backend when it's available
This commit is contained in:
parent
dc383ed4ce
commit
22a9a1a630
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ if (!BUILD_DEFS.DISABLE_WEBGL) {
|
|||
|
||||
if (!BUILD_DEFS.DISABLE_WASM) {
|
||||
const wasmBackend = require('./backend-wasm').wasmBackend;
|
||||
if (!BUILD_DEFS.DISABLE_WEBGPU) {
|
||||
if (!BUILD_DEFS.DISABLE_WEBGPU && typeof navigator !== 'undefined' && navigator.gpu) {
|
||||
registerBackend('webgpu', wasmBackend, 5);
|
||||
}
|
||||
registerBackend('cpu', wasmBackend, 10);
|
||||
|
|
|
|||
Loading…
Reference in a new issue