Skip to content

Commit

Permalink
calculate timestamp mask
Browse files Browse the repository at this point in the history
  • Loading branch information
zma2 committed Jun 22, 2022
1 parent 40f1236 commit 601cec3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.45.1
0.46.0
10 changes: 8 additions & 2 deletions utils/ze_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,13 @@ inline uint64_t GetMetricTimestampMask(ze_device_handle_t device) {
ze_device_properties_t props{ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2, };
ze_result_t status = zeDeviceGetProperties(device, &props);
PTI_ASSERT(status == ZE_RESULT_SUCCESS);
return (1ull << props.kernelTimestampValidBits) - 1ull;
uint32_t devicemask = (props.deviceId & 0xFF00);
if ((devicemask == 0x5600) || (devicemask == 0x4F00) || (devicemask == 0x0B00)) {
return (1ull << (props.kernelTimestampValidBits - 1)) - 1ull;
}
else {
return (1ull << props.kernelTimestampValidBits) - 1ull;
}
#endif
}

Expand All @@ -391,4 +397,4 @@ inline ze_api_version_t GetVersion() {
} // namespace ze
} // namespace utils

#endif // PTI_UTILS_ZE_UTILS_H_
#endif // PTI_UTILS_ZE_UTILS_H_

0 comments on commit 601cec3

Please sign in to comment.