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

70 Views Asked by At

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?

1

There are 1 best solutions below

0
Frank Rupprecht On BEST ANSWER

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.