Same drill, different uniform
Recall: Metal has no GPU printf. So the configurable-battalion version on Apple Silicon writes per-thread identity into a buffer, the CPU prints. Same mission as the CUDA version.
Two key differences from CUDA you'll feel:
- The 'block size' lives in two places — the kernel's hard-coded constant and the host's
threadsPerThreadgroup. They must agree, and Metal won't always tell you when they don't. - The host driver explicitly waits with
commandBuffer.waitUntilCompleted(); that's Metal'scudaDeviceSynchronize.