resident
이 페이지에서

resident()

함수, 런타임 분류

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'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

function resident<T>(value: T): Resident<T>

매개변수

value T

a number, a tuple, a Float32Array, Int32Array, Uint32Array or Float64Array, an array, or an object for a struct.

반환값

Resident<T>

the handle, whose write replaces its contents and destroy frees its buffer.

예외

TypeError

TypeError for any other value.

설명

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.

소스

src/core/resident.ts, 160행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고