규칙 8.7
이 페이지에서

규칙 8.7

8장, 함수와 진입점 테스트

@compute carries the workgroup size as an array literal of one to three whole numbers, x, y and z, a missing y or z being 1, and the default is 64; every extent reaches the emitted @workgroup_size and the reflection, and a shape over WebGPU’s default compute limits must be reported as a warning.

규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

근거

an argument the decorator cannot read must not fall through to a default the author did not ask for, and an extent the author wrote must not be dropped. The limits are the device’s, not the language’s: a device requested with raised limits runs a larger workgroup, so a shape over the defaults compiles, and the warning says which limit the host has to raise.

출처

workgroup_size; WebGPU Limits (maxComputeWorkgroupSizeX and Y 256, Z 64, maxComputeInvocationsPerWorkgroup 256); #118.

검증 방식

테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.

컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.

  • TS8037 WORKGROUP_ARG, where a bare @compute emits @workgroup_size(64) and the object form is refused (@compute takes an array of one to three whole numbers, "@compute([64, 1, 1])", or no argument for the default of 64; "{ workgroup: [64, 1, 1] }" is not a workgroup shape.);
  • TS8026 WORKGROUP_SHAPE, a warning naming the first default limit the shape exceeds;
  • SD0111, which keeps a portable kernel’s workgroup one-dimensional, since the WebGL2 lowering has no workgroup;
  • surface §3’s bullets on the payload of @compute, under the entry example, which state the default of 64, the emitted spelling of a two- or three-dimensional shape, the limits warning, and the refused object form.

커밋 c66579bf에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.

설명하는 절

커밋 c66579bf의 표면 문서에서 이 규칙을 설명하는 절입니다.

적용하는 오류 코드

규칙이 Enforced by 항목에서 가리키는 진단 코드와, 레지스트리 설명에서 이 규칙을 가리키는 진단 코드입니다.

SD0111
portable kernel outside the gather-only tier
TS8026 WORKGROUP_SHAPE
A warning: @compute([x, y, z]) exceeds one of WebGPU's default compute limits (x and y 256, z 64, 256 invocations in all), so a device requested without raising that limit refuses the pipeline.
TS8037 WORKGROUP_ARG
@compute(...) with an argument that is not an array literal of one to three whole numbers: an object, a bare number, an identifier, an empty or four-wide array.

함께 보기

소스

커밋 c66579bf의 규칙 원문:

이 페이지 편집 문제 보고