metalmetal-performance-shaders

How to implement scalar operation of all elements of matrix in Metal Performance Shaders?


Let's say I have a matrix, and I want to compute sin() on all elements.

How do I do that with metal performance shaders?

Do I write some new kernel inheriting from MPSMatrixUnaryKernel?


Solution

  • I think MPS is not meant to be extended. You can "simply" write your own Metal compute shader for that.

    This seems to be a good tutorial to get started. 🙂