Readability improvement by using device_clock alias - #419
Merged
oleksandr-pavlyk merged 1 commit intoJul 20, 2026
Merged
Conversation
Use `device_clock = cuda::std::chrono::high_resolution_clock;` for readability improvement, and a chance for comment to state that using it in device code for timing purposes is correct and intentional. I looked at this as a follow-up to NVIDIA#371, which replaced std::chrono::high_resolution_clock with std::chrono::steady_clock. Per https://nvidia.github.io/cccl/unstable/libcudacxx/standard_api/time_library.html type cuda::std::chrono::steady_clock is not provided, and while high_resolution_clock is not heterogeneously steady, but is steady within device code and suitable for device-side performance measurement.
NaderAlAwar
approved these changes
Jul 20, 2026
Collaborator
Author
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDevice timing measurements were refactored to use ChangesDevice timing refactor
Comment |
oleksandr-pavlyk
deleted the
high-resolution-clock-in-device-code-is-fine
branch
July 20, 2026 16:05
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.
Use alias
device_clock = cuda::std::chrono::high_resolution_clock;for readability improvement, and a chance for comment to state that using it in device code for timing purposes is correct and intentional.I looked at this as a follow-up to #371, which replaced std::chrono::high_resolution_clock with std::chrono::steady_clock.
Per https://nvidia.github.io/cccl/unstable/libcudacxx/standard_api/time_library.html type
cuda::std::chrono::steady_clockis not provided, and whilecuda::std::chrono::high_resolution_clockis not heterogeneously steady, but is steady within device code and suitable for device-side performance measurement.