Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on kokkos/kokkos#3812
One hope I have for that design is that our simple tools can be given complex capabilities using "overlays," (a concept I'm shamelessly stealing from @nmhamster and @jrmadsen ). This PR introduces some infrastructure to enable that concept, and two example overlays.
First, I formalized the process for forwarding your callbacks to a next tool, using a "callback_chainer" struct, which handles loading a next library, grabbing callbacks, all that mess.
The first example overlay is a trivial "passthrough" overlay. All it does is forward events, I basically used it to prove out the callback_chainer thing.
The other is a sampler overlay. This turns off Kokkos global fencing, and then every 101 kernel invocations (that should be a settable parameter) it forwards the kernel to an underlying tool. Fences are only introduced in the case where the kernel is profiled. I've tested this with the space-time-stack and TAU (TAU through modifying tau_exec).
What's neat here is that space-time-stack is completely unmodified, but gets this sampling capability "for free." It's kind of a deeply weird version of a modular tools framework.
Not sure how I feel about this design as a thing to merge, mainly just putting it up as another proof of concept for the Core PR