简体   繁体   中英

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM