resident()
Function in Runtime
Wrap a host value once so that it stays on the device across calls: const dev = resident(new Float32Array(512 * 512)); render; const img = await dev.read().
import { resident } from 'typeshade'import { resident } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
function resident<T>(value: T): Resident<T>Parameters
valueTa number, a tuple, a
Float32Array,Int32Array,Uint32ArrayorFloat64Array, an array, or an object for a struct.
Return value
Resident<T>
the handle, whose write replaces its contents and destroy frees its buffer.
Exceptions
TypeErrorTypeErrorfor any other value.
Description
A kernel or entry call takes the handle where it takes the value, and a program
of typeshade/runtime takes it as a binding. The handle holds its own copy of value.
Source
src/core/resident.ts, line 160, at commit 26de7be8