Skip to content

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

@svilupp

Description

@svilupp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions