Uh oh!
There was an error while loading. Please reload this page.
Add event timing - #481
Conversation
leofang
commented
Mar 3, 2025
/ok to test |
This comment has been minimized.
This comment has been minimized.
leofang
commented
Mar 3, 2025
/ok to test |
carterbox
left a comment
There was a problem hiding this comment.
I like the semantics of this implementation. It wouldn't have thought that you could directly subtract two Events to get the difference between them in time, but I like it.
One thing that may be missing is documentation of what happens if timing is not enabled. What is the expected behavior? I suspect the answer is that the difference is zero, but raising an error because we tried to do timing without enabling timing seems more pythonic.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
leofang
commented
Mar 4, 2025
Currently we do raise an exception since the driver API would return an error if the events were created without timing enabled: So the question is if we want to do an exception chaining and raise, say, |
leofang
commented
Mar 4, 2025
We ensure this exception is raised in commit 8aca468. The discussion for an optional exception chaining is still open. |
If it's possible to catch and reraise the error with a message like "Timing must be enabled in order subtract Events. Events have timing disabled by default." That would be better than "invalid resource handle". |
Uh oh!
There was an error while loading. Please reload this page.
leofang
commented
Mar 6, 2025
/ok to test |
leofang
commented
Mar 6, 2025
This is ready. |
rwgk
left a comment
There was a problem hiding this comment.
Seeing the code now, I like the exception chaining approach better than the idea I posted before.
leofang
commented
Mar 6, 2025
Thanks, Ralf/Daniel! |
|
When working on #475 (68c9365) I noticed we surprisingly haven't implemented event-based timing... Looks like an oversight to me because we did spend a lot of time discussing the default of the
enabling_timingoption and how to retrieve the timing result. This PR adds the implementation, which is also aligned with thecuda::experimental::timed_eventtreatment:https://github.com/NVIDIA/cccl/blob/096596b3580d6cb2042fff692e8162d2a0ea356b/cudax/include/cuda/experimental/__event/timed_event.cuh#L90