JuliaGPU/Metal.jl

Q: How to debug kernels - KA.@print?

svilupp opened this issue · 0 comments

First of all, thank you for the awesome package!

How do you print / introspect your kernels?

Eg,

  • how do you introspect the grid/hierarchy in your object? (I have read the Apple docs but I'm struggling to imagine how that hierarchy looks in my matrix)
  • see results of calls like dispatch_simdgroups_per_threadgroup() or sgitg=simdgroup_index_in_threadgroup()?
  • how do you check that your inner loops are correct?
  • any other tips and tricks that help you debug your kernel?

I couldn't find any examples in the repo and @print doesn't seem to be implemented?

Context:
I was hoping to replicate a kernel using SIMD groups (example in .metal, but I cannot figure out the indexing with simdgroup_index_in_threadgroup etc, because I'm not even sure how the grid looks.