[UR][L0] Query timer resolution in cycles/sec for accurate timestamp#21279
Open
againull wants to merge 1 commit intointel:syclfrom
Open
[UR][L0] Query timer resolution in cycles/sec for accurate timestamp#21279againull wants to merge 1 commit intointel:syclfrom
againull wants to merge 1 commit intointel:syclfrom
Conversation
fa6e999 to
aa9c7c1
Compare
According to Level Zero the meaning of timerResolution depends on stype: - ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES -> units are nanoseconds (uint64, already rounded) - ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 -> units are cycles/sec Previously we queried using ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES and used the integer nanosecond value, which introduced rounding error and reduced timestamp accuracy. That could occasionally make the SYCL runtime report submit time > start time. Instead, query timerResolution with ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 (cycles/sec) and compute nanoseconds-per-cycle as a double to preserve precision.
aa9c7c1 to
da455e9
Compare
Contributor
Author
|
@intel/unified-runtime-reviewers-level-zero Could you please review. |
kswiecicki
approved these changes
Feb 20, 2026
Contributor
|
@intel/llvm-gatekeepers please consider merging |
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.
According to Level Zero spec the meaning of
timerResolutiondepends onstype:ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES-> units are nanoseconds (uint64, already rounded)ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2-> units are cycles/sec (exact value)Previously we queried using
ZE_STRUCTURE_TYPE_DEVICE_PROPERTIESand used the integer nanosecond value, which introduced rounding error and reduced timestamp accuracy.Instead, query
timerResolutionwithZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2(cycles/sec) and compute nanoseconds-per-cycle as a double to preserve precision.This fix improves the accuracy of timestamp reported from
urDeviceGetGlobalTimestampsand others.