configure
이 페이지에서

configure()

함수, 런타임 분류

Set how a kernel call or a @compute entry's call runs (Rule 11.8).

import { configure } from 'typeshade'
import { configure } from 'typeshade/runtime'

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

구문

function configure(options: {
readonly prefer?: readonly Tier[];
readonly runtime?: { readonly device: object } | null;
}): void

매개변수

options { readonly prefer?: readonly Tier[]; readonly runtime?: { readonly device: object } | null; }

prefer, a non-empty list of 'webgpu', 'webgl2' and 'cpu'; runtime, a runtime or null. configure({}) restores the default order.

반환값

void

예외

TypeError

TypeError for an empty list, a repeated entry or an unknown tier, and for a runtime with no device.

설명

prefer is the order of the tiers it tries: WebGPU, WebGL2 and the CPU tier, the default being all three in that order. A one-entry list makes that tier required, and a call that cannot run on it throws, naming why: configure({ prefer: ['webgpu'] }).

runtime is a program runtime (createRuntime(), change 0025) whose device every call uses, so a texture or a Resident the host made on it reaches a call; null returns to the default device. Left out, each option keeps its value.

소스

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

이 페이지 편집 문제 보고