Getting started with Metal.jl

Hi everyone.
So, I have never worked with GPU, I have a M1 Mac and I am trying to get some codes of mine to run faster. I have a code that I know very well and I thought it might be a good exercise to translate it to Metal.jl. Unfortunately I am not getting very lucky at doing for loops, if statements etc with the MetalArrays.

Anyone has some examples (beyond the Metal.jl Docs) or a tutorial for a GPU newbie.

Kind regards to all.
M.

Please be more specific and show an example of what isn’t working. It’s unclear to me if you’re trying to use array operations, or trying to write a kernel. In any case, you can look at the docs/examples of e.g. CUDA.jl, which is similar to Metal.jl.