/// import { Shape } from "./shape"; import { ATypedArray, Dtype } from "./dtype"; import type { UntypedStorage } from "./storage"; import { Kernel, KernelConfig, KernelConfigInput, KernelSpec } from "./kernel"; export type DeviceType = "cpu" | "webgpu"; export type DeviceId = string; export type Deviceish = DeviceType | Device | DeviceId; export declare abstract class Device { private _id; private _type; private _kernels; get id(): DeviceId; get type(): DeviceType; constructor(id: DeviceId, type: DeviceType); abstract alloc(byteSize: number): UntypedStorage; allocFor(shape: Shape, dtype: Dtype): UntypedStorage; getKernel(name: string, config: KernelConfigInput): Kernel; abstract createKernel(spec: KernelSpec, config: KernelConfig): Kernel; abstract getBufferForKernel(storage: UntypedStorage, dtype: Dtype): ATypedArray | GPUBuffer; abstract getStorageFromKernel(buffer: ATypedArray | GPUBuffer): UntypedStorage; }