Add Metal support#525
Conversation
Co-authored-by: Theo dammaretz <theo@dammaretz.fr>
as this is already being passed around
use same approach of switching on Dialect
just take a list of arg types
c624a95 to
0137cdb
Compare
this is more similar to what is already done for IR transform steps among other things
0137cdb to
dcf83a6
Compare
jw1912
left a comment
There was a problem hiding this comment.
Looks good! I have some nitpicks - mostly about imports
|
Do you want me to try adding a CI job for this? I don't think the macOS runners have Metal, but we still might be able to run |
Maybe in a separate PR? |
|
If you fix that clippy error by using |
these were left over from the previous change's ad-hoc bindings and aren't necessary
Fixed that and the 'too many args' one, those functions were still there because of the original change having those ad-hoc bindings and could be inlined.
There's not a lot to do as everything should 'just work' after enabling the feature. But I've added that step anyway (plus it's the only place the available backends are listed I believe. |
|
Nice! And just to confirm if you run |
|
@jw1912 Yep, all green! |
Used Blightwidow's attempt as a starting point, but have:
objc2and replaced the ad-hoc bindings to MPS withobjc2-metal-performance-shadersmetal.rsorDialectamong other cleanups and simplificationsI've left the commit history untouched (since the
objc2port which I posted about in the linked issue) to give an idea of the changes, but will squash if things look ok.There's a much larger potential refactoring (splitting all the Metal stuff into
bullet-metaland the common code intobullet-compileras @jw1912 said in #500) which I haven't tackled, but let me know if you feel like this is a pre-requisite for merging.Fixes #500