Why Metal still asks where GPU inputs are in Mac memory

Macs use , where the CPU and GPU share the same memory space. That means data does not need to be copied from separate CPU memory to separate in the same way it often is in CUDA.

Metal still requires each value passed into a GPU kernel to be marked with something like [[buffer(i)]]. This does not mean the data is being moved.

It tells the GPU which buffer slot contains the specific input it should read. For someone coming from CUDA, this can feel confusing because sounds like should be passed directly.

Key points

  • Macs use shared by the CPU and GPU.
  • Metal still needs GPU kernel inputs to be bound to buffer slots.
  • [[buffer(i)]] tells the GPU which input buffer to read.
  • CUDA experience can make this feel surprising because the memory model looks simpler on Macs.
Read original