WebNN support initial

This commit is contained in:
Lucas Winther
2026-07-10 11:18:03 +02:00
parent 71cb61cd90
commit db7b8a22c4
5 changed files with 41 additions and 17 deletions
+2 -2
View File
@@ -7,7 +7,7 @@
*/
/** Devices the worker can actually run on (D-004). */
export type InferenceDevice = "webgpu" | "wasm";
export type InferenceDevice = "webgpu" | "wasm" | "webnn";
/**
* What the UI may request. "auto" (the default) lets the worker probe
@@ -147,7 +147,7 @@ function isOptionalString(value: unknown): value is string | undefined {
return value === undefined || typeof value === "string";
}
const DEVICES: readonly string[] = ["webgpu", "wasm"];
const DEVICES: readonly string[] = ["webgpu", "wasm", "webnn"];
const DTYPES: readonly string[] = ["fp32", "fp16", "q8", "q4"];
export function isInferenceDevice(value: unknown): value is InferenceDevice {