Open cwpearson opened 7 months ago
Corresponding Core PR: https://github.com/kokkos/kokkos/pull/6844
@crtrott I discussed this with Carl. Carl is using this for his work. This would also well-serve Kokkos Tools because it is a basis to have a generalized ToolState struct that the Kokkos Tools users can use to obtain profiling information per kernel invocation. This ToolsState came out of a discussion from @jrmadsen in #147.
I looked over this and it looks like the implementation is correct. The only question is whether we want to merge this, or if we want to provide a generalized tool callback than one marking the functor size - maybe something like kp_mark_kernel_info()
(the kernel is indexed by the kernel ID passed in as a parameter to the function callback).
One note to consider (@cwpearson - we didn't discuss this) is that functor size is compile-time information and doesn't change dynamically at runtime. I wonder whether doing this in tool callbacks is the only way.
This PR forms the basis for dynamically changing information/properties of a Kokkos kernel.
@vlkale I changed the name of the callback to mark_kernel_static_info and defined a 512-byte struct, so while this currently only tracks functor size, it could be extended to include other info.
@vlkale I changed the name of the callback to mark_kernel_static_info and defined a 512-byte struct, so while this currently only tracks functor size, it could be extended to include other info.
Great, thanks!
Prints the count, size, and name of functors passed to Kokkos parallel regions.