C++11에 attribute 괄호 추가 — 그리고 architectural twist 하나
Metal Shading Language (MSL)이 .metal 파일 안에 쓰는 거야. CUDA 개발자가 보면 즉시 친숙해 — function qualifier로 GPU entry 표시, attribute 괄호로 SIMT index 노출, address-space 키워드로 memory region 명시. 그래픽스 개발자가 보면 GLSL의 더 lean하고 typed한 사촌처럼 보여.
가장 중요한 확장 셋:
kernelfunction qualifier — CPU가 launch하는 GPU entry. CUDA의__global__쌍둥이.- Attribute 괄호 —
[[thread_position_in_grid]],[[threadgroup_position_in_grid]],[[thread_index_in_threadgroup]]. Metal의threadIdx+blockIdx답. - Address-space 키워드 —
device,threadgroup,constant,thread— 포인터가 어느 메모리 region에 사는지 명시. CUDA는__shared__/__constant__로 추론, Metal은 type의 일부로 만들어.
나머지는 표준 C++11 + Apple 확장이야: packed vector (float4, half3), threadgroup barrier, math built-in. 전체 MSL spec이 PDF 한 권 — 오후에 다 읽혀.
눈에 띄지 않게 숨어있는 architectural twist: Apple Silicon에선 device 메모리랑 CPU-visible 메모리가 같은 물리 RAM이야. 다음 레슨 통째로 이거 다룰 거.