createDevice()
Function in Runtime
Open the owner of a host's kernel calls: on the first tier of prefer that opens, on a GPUDevice the host already has, or on the device of a program runtime.
import { createDevice } from 'typeshade'import { createDevice } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
async function createDevice(options: DeviceOptions = {}): Promise<Device>Parameters
optionsoptionalDeviceOptionsprefer,deviceorruntime, one of them; instance-local WebGPUlimitsandfeatures;poolBytes,fp64FlavorandtimeBudgetMs, the time one chunk of a long kernel may take (change 0074). Omittedfp64Flavormeans'auto', resolved from this device without requesting an unrelated adapter.
Return value
Promise<Device>
the device.
Exceptions
TypeErrorTypeErrorfor options that do not fit, a word that is not a flavor among them;RangeErrorfor atimeBudgetMsthat is not a finite number from 1 to 60000;Errornaming each tier’s reason when no tier ofpreferopens.
Description
The device’s
array() makes the Buffers its calls take, fuse() runs a body’s calls as one plan
on it, and dispose() frees what it made. Two devices in one context are independent, and the
process-global configure(), array() and fuse() describe the default owner as before.
In the guide
Source
src/runtime/device.ts, line 753, at commit af54ddad5