From 601cec3c4e480f4a1b359bc9f0b78fcc1b99dd6b Mon Sep 17 00:00:00 2001 From: zma2 Date: Wed, 22 Jun 2022 19:09:45 -0400 Subject: [PATCH] calculate timestamp mask --- VERSION | 2 +- utils/ze_utils.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index ff12df2..3010923 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.45.1 +0.46.0 diff --git a/utils/ze_utils.h b/utils/ze_utils.h index 6b8bad1..e324903 100644 --- a/utils/ze_utils.h +++ b/utils/ze_utils.h @@ -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 } @@ -391,4 +397,4 @@ inline ze_api_version_t GetVersion() { } // namespace ze } // namespace utils -#endif // PTI_UTILS_ZE_UTILS_H_ \ No newline at end of file +#endif // PTI_UTILS_ZE_UTILS_H_