DeviceInfo
이 페이지에서

DeviceInfo

인터페이스, 런타임 분류

열린 디바이스의 메타데이터를 과거 기록으로 보관합니다. 수정할 수 없고 JSON으로 직렬화할 수 있습니다.

import type { DeviceInfo } from 'typeshade'
import type { DeviceInfo } from 'typeshade/runtime'

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

구문

interface DeviceInfo {
readonly build: TypeShadeBuildInfo;
readonly tier: Tier;
readonly webgpu: { readonly provenance: 'device' | 'adapter' | 'unavailable'; readonly vendor: string | null; readonly architecture: string | null; readonly device: string | null; readonly description: string | null; readonly fallback: boolean | null; readonly features: readonly string[]; readonly limits: Readonly<Record<string, number>>; } | null;
readonly webgl: { readonly vendor: string | null; readonly renderer: string | null; readonly unmaskedVendor: string | null; readonly unmaskedRenderer: string | null; } | null;
readonly subgroups: { readonly minSize: number | null; readonly maxSize: number | null; readonly size: number; readonly numSubgroups: number; readonly consecutive: boolean; } | null;
}

설명

열린 디바이스의 메타데이터를 과거 기록으로 보관합니다. 수정할 수 없고 JSON으로 직렬화할 수 있습니다. 디바이스를 잃거나 해제한 뒤에도 읽을 수 있으며, 개별 호출이 실제로 실행된 tier를 나타내지는 않습니다. typeshade와 typeshade/runtime에서 내보냅니다(변경 0083).

인스턴스 속성

build읽기 전용 TypeShadeBuildInfo
tier읽기 전용 Tier
webgpu읽기 전용 { readonly provenance: 'device' | 'adapter' | 'unavailable'; readonly vendor: string | null; readonly architecture: string | null; readonly device: string | null; readonly description: string | null; readonly fallback: boolean | null; readonly features: readonly string[]; readonly limits: Readonly<Record<string, number>>; } | null

실제 WebGPU 디바이스나 그 디바이스를 만든 어댑터에서 보관한 식별 정보입니다. 기능과 한도는 활성화된 디바이스의 값입니다. 어댑터가 지원하는 최댓값이 아닙니다. 다른 tier에서는 null입니다.

webgl읽기 전용 { readonly vendor: string | null; readonly renderer: string | null; readonly unmaskedVendor: string | null; readonly unmaskedRenderer: string | null; } | null

실제 WebGL2 컨텍스트가 제공한 문자열입니다. 디버그 문자열이 제공되지 않거나 가려지면 null입니다. 별도로 만든 WebGL 컨텍스트의 관측값을 WebGPU 디바이스의 정보로 쓰지 않습니다.

subgroups읽기 전용 { readonly minSize: number | null; readonly maxSize: number | null; readonly size: number; readonly numSubgroups: number; readonly consecutive: boolean; } | null

디바이스가 열릴 때 서브그룹 프로브가 관찰한 값입니다(변경 0119). 어댑터의 크기 범위, 256 레인짜리 워크그룹 하나의 subgroup_size와 num_subgroups, 그리고 서브그룹의 레인이 연속이었는지를 담습니다. WebGPU가 없는 tier, subgroups 기능이 없는 디바이스, createDevice({ subgroups: 'off' })로 프로브를 끈 경우, 프로브가 실패한 경우에는 null입니다. 이때 그 디바이스의 커널 호출은 트리 텍스트를 실행합니다.

소스

src/core/device-info.ts, 11행, 커밋 af54ddad5 기준

이 페이지 편집 문제 보고