diff --git a/sdk/src/utils/ze_utils.h b/sdk/src/utils/ze_utils.h index dfa11f3b..fce77112 100644 --- a/sdk/src/utils/ze_utils.h +++ b/sdk/src/utils/ze_utils.h @@ -510,7 +510,7 @@ inline uint64_t GetDeviceTimestampMask(ze_device_handle_t device) { o_api_string.c_str()); }; PTI_ASSERT(status == ZE_RESULT_SUCCESS); - return ((props.kernelTimestampValidBits == 64) ? std::numeric_limits::max() + return ((props.kernelTimestampValidBits == 64) ? (std::numeric_limits::max)() : ((1ull << props.kernelTimestampValidBits) - 1ull)); } @@ -533,7 +533,7 @@ inline uint64_t GetMetricTimestampMask(ze_device_handle_t device) { if ((devicemask == 0x5600) || (devicemask == 0x4F00) || (devicemask == 0x0B00)) { return (1ull << (props.kernelTimestampValidBits - 1)) - 1ull; } else { - return ((props.kernelTimestampValidBits == 64) ? std::numeric_limits::max() + return ((props.kernelTimestampValidBits == 64) ? (std::numeric_limits::max)() : ((1ull << props.kernelTimestampValidBits) - 1ull)); } #endif diff --git a/tools/oneprof/prof_options.h b/tools/oneprof/prof_options.h index de3457dc..6426dc60 100644 --- a/tools/oneprof/prof_options.h +++ b/tools/oneprof/prof_options.h @@ -60,7 +60,7 @@ class ProfOptions { } std::string GetLogFileName( - uint32_t pid = std::numeric_limits::max()) const { + uint32_t pid = (std::numeric_limits::max)()) const { if (log_file_.empty()) { return std::string(); } @@ -74,7 +74,7 @@ class ProfOptions { result << log_file_.substr(0, pos); } - if (pid == std::numeric_limits::max()) { + if (pid == (std::numeric_limits::max)()) { pid = utils::GetPid(); } result << "." + std::to_string(pid); diff --git a/utils/ze_utils.h b/utils/ze_utils.h index 50f983bb..58a244af 100644 --- a/utils/ze_utils.h +++ b/utils/ze_utils.h @@ -356,7 +356,7 @@ 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 ((props.kernelTimestampValidBits == 64) ? std::numeric_limits::max() + return ((props.kernelTimestampValidBits == 64) ? (std::numeric_limits::max)() : ((1ull << props.kernelTimestampValidBits) - 1ull)); } @@ -372,7 +372,7 @@ inline uint64_t GetMetricTimestampMask(ze_device_handle_t device) { return (1ull << (props.kernelTimestampValidBits - 1)) - 1ull; } else { - return ((props.kernelTimestampValidBits == 64) ? std::numeric_limits::max() + return ((props.kernelTimestampValidBits == 64) ? (std::numeric_limits::max)() : ((1ull << props.kernelTimestampValidBits) - 1ull)); } #endif