/add-arrays-metal-cpp

Project to learn about gpu programming on mac. I'm using the metal-cpp library and following the add arrays tutorial from apple.

Primary LanguageC++

GPU Array Addition Using Metal

I followed the tutorial here for performing calculations on the GPU using Metal. I chose to rewrite the example using C++ and the metal-cpp library. The metal-cmake setup can be found in this repository along with other helpful examples.

The goal was to learn about how GPU computation pipelines work. In summary:

  1. Request a GPU device.
  2. Establish a library on the device that consists of compiled MSL.
  3. Use functions to create pipeline state.
  4. Get a command queue, command buffer, and command encoder.
  5. Use the encoder to load variables, pipeline state, and thread specification.
  6. Close the encoder and commit the buffer to the queue.
  7. Wait for your work to be scheduled and executed.