improve device performance timing for kernels only - #478
Merged
bashbaug merged 5 commits intoAug 27, 2026
Merged
Conversation
If we do not care about device performance timing for non-kernel commands, skip creating an event for these commands if one is not requested by the application.
Since we've already checked for DevicePerformanceTimingKernelsOnly when determining whether to do device performance timing, we do not need to check for it again to determine whether to add the timing event.
It's a lot easier to always have the correct error code available for map commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Changes
If we are only collecting device performance timing for kernels, there is no need to attach an event to non-kernel commands when no event is requested by the application, which saves unnecessary event creation and immediate destruction.
Also adds a cliloader command-line option to collect device performance timing for kernels only.
Also fixes an issue preventing device performance timing information from being collected for buffer and image map commands. Unlike other enqueue commands, buffer and image map commands return the pointer being mapped rather than an OpenCL error code.
Testing Done
Tested with a simple test app. Verified that all device performance timing information is reported (including for maps and unmaps) when no additional controls are set, and that only kernel device performance timing is reported when the control to collect device performance timing for kernels only is set.