Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions utils/ze_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ inline uint64_t GetDeviceTimestampMask(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;
return ((props.kernelTimestampValidBits == 64) ? std::numeric_limits<uint64_t>::max()
: ((1ull << props.kernelTimestampValidBits) - 1ull));
}

inline uint64_t GetMetricTimestampMask(ze_device_handle_t device) {
Expand All @@ -371,7 +372,8 @@ inline uint64_t GetMetricTimestampMask(ze_device_handle_t device) {
return (1ull << (props.kernelTimestampValidBits - 1)) - 1ull;
}
else {
return (1ull << props.kernelTimestampValidBits) - 1ull;
return ((props.kernelTimestampValidBits == 64) ? std::numeric_limits<uint64_t>::max()
: ((1ull << props.kernelTimestampValidBits) - 1ull));
}
#endif
}
Expand Down