diff --git a/level_zero/sysman/source/power/linux/sysman_os_power_imp_prelim.cpp b/level_zero/sysman/source/power/linux/sysman_os_power_imp_prelim.cpp index 0971ab2802..8511fdb550 100644 --- a/level_zero/sysman/source/power/linux/sysman_os_power_imp_prelim.cpp +++ b/level_zero/sysman/source/power/linux/sysman_os_power_imp_prelim.cpp @@ -205,7 +205,7 @@ ze_result_t LinuxPowerImp::setLimitsExt(uint32_t *pCount, zes_power_limit_ext_de uint64_t val = 0; for (uint32_t i = 0; i < *pCount; i++) { if (pSustained[i].level == ZES_POWER_LEVEL_SUSTAINED) { - val = pSustained[i].limit * milliFactor; // Convert milliwatts to microwatts + val = static_cast(pSustained[i].limit) * milliFactor; // Convert milliwatts to microwatts result = pSysfsAccess->write(sustainedPowerLimit, val); if (ZE_RESULT_SUCCESS != result) { NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): SysfsAccess->write() failed to write into %s/%s and returning error:0x%x \n", __FUNCTION__, intelGraphicsHwmonDir.c_str(), sustainedPowerLimit.c_str(), getErrorCode(result)); @@ -221,7 +221,7 @@ ze_result_t LinuxPowerImp::setLimitsExt(uint32_t *pCount, zes_power_limit_ext_de if (productFamily == IGFX_PVC) { val = pSustained[i].limit; } else { - val = pSustained[i].limit * milliFactor; // Convert milliwatts to microwatts + val = static_cast(pSustained[i].limit) * milliFactor; // Convert milliwatts to microwatts } result = pSysfsAccess->write(criticalPowerLimit, val); if (ZE_RESULT_SUCCESS != result) { diff --git a/level_zero/tools/source/sysman/power/linux/os_power_imp_prelim.cpp b/level_zero/tools/source/sysman/power/linux/os_power_imp_prelim.cpp index d094f3019e..fb6c3c9df4 100644 --- a/level_zero/tools/source/sysman/power/linux/os_power_imp_prelim.cpp +++ b/level_zero/tools/source/sysman/power/linux/os_power_imp_prelim.cpp @@ -208,7 +208,7 @@ ze_result_t LinuxPowerImp::setLimitsExt(uint32_t *pCount, zes_power_limit_ext_de uint64_t val = 0; for (uint32_t i = 0; i < *pCount; i++) { if (pSustained[i].level == ZES_POWER_LEVEL_SUSTAINED) { - val = pSustained[i].limit * milliFactor; // Convert milliwatts to microwatts + val = static_cast(pSustained[i].limit) * milliFactor; // Convert milliwatts to microwatts result = pSysfsAccess->write(i915HwmonDir + "/" + sustainedPowerLimit, val); if (ZE_RESULT_SUCCESS != result) { NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): SysfsAccess->write() failed to write into %s/%s and returning error:0x%x \n", __FUNCTION__, i915HwmonDir.c_str(), sustainedPowerLimit.c_str(), getErrorCode(result)); @@ -224,7 +224,7 @@ ze_result_t LinuxPowerImp::setLimitsExt(uint32_t *pCount, zes_power_limit_ext_de if (productFamily == IGFX_PVC) { val = pSustained[i].limit; } else { - val = pSustained[i].limit * milliFactor; // Convert milliwatts to microwatts + val = static_cast(pSustained[i].limit) * milliFactor; // Convert milliwatts to microwatts } result = pSysfsAccess->write(i915HwmonDir + "/" + criticalPowerLimit, val); if (ZE_RESULT_SUCCESS != result) { diff --git a/shared/source/device_binary_format/elf/elf_decoder.cpp b/shared/source/device_binary_format/elf/elf_decoder.cpp index e24475a066..7c44a53d27 100644 --- a/shared/source/device_binary_format/elf/elf_decoder.cpp +++ b/shared/source/device_binary_format/elf/elf_decoder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -44,12 +44,12 @@ Elf decodeElf(const ArrayRef binary, std::string &outErr return {}; } - if (ret.elfFileHeader->phOff + ret.elfFileHeader->phNum * ret.elfFileHeader->phEntSize > binary.size()) { + if (ret.elfFileHeader->phOff + static_cast(ret.elfFileHeader->phNum * ret.elfFileHeader->phEntSize) > binary.size()) { outErrReason = "Out of bounds program headers table"; return {}; } - if (ret.elfFileHeader->shOff + ret.elfFileHeader->shNum * ret.elfFileHeader->shEntSize > binary.size()) { + if (ret.elfFileHeader->shOff + static_cast(ret.elfFileHeader->shNum * ret.elfFileHeader->shEntSize) > binary.size()) { outErrReason = "Out of bounds section headers table"; return {}; } diff --git a/shared/source/os_interface/linux/ioctl_helper.cpp b/shared/source/os_interface/linux/ioctl_helper.cpp index 615d225cc8..6bd7abf9c4 100644 --- a/shared/source/os_interface/linux/ioctl_helper.cpp +++ b/shared/source/os_interface/linux/ioctl_helper.cpp @@ -441,7 +441,7 @@ bool IoctlHelper::translateTopologyInfo(const QueryTopologyInfo *queryTopologyIn subSliceIndices.reserve(queryTopologyInfo->maxSubslices); for (int y = 0; y < queryTopologyInfo->maxSubslices; y++) { - size_t yOffset = (queryTopologyInfo->subsliceOffset + x * queryTopologyInfo->subsliceStride + y / 8); + size_t yOffset = (queryTopologyInfo->subsliceOffset + static_cast(x * queryTopologyInfo->subsliceStride) + y / 8); bool isSubSliceEnabled = (queryTopologyInfo->data[yOffset] >> (y % 8)) & 1; if (!isSubSliceEnabled) { continue; @@ -450,7 +450,7 @@ bool IoctlHelper::translateTopologyInfo(const QueryTopologyInfo *queryTopologyIn subSliceIndices.push_back(y); for (int z = 0; z < queryTopologyInfo->maxEusPerSubslice; z++) { - size_t zOffset = (queryTopologyInfo->euOffset + (x * queryTopologyInfo->maxSubslices + y) * queryTopologyInfo->euStride + z / 8); + size_t zOffset = (queryTopologyInfo->euOffset + static_cast((x * queryTopologyInfo->maxSubslices + y) * queryTopologyInfo->euStride) + z / 8); bool isEUEnabled = (queryTopologyInfo->data[zOffset] >> (z % 8)) & 1; if (!isEUEnabled) { continue; diff --git a/shared/source/program/kernel_info.h b/shared/source/program/kernel_info.h index 13b64316d1..02765c54c1 100644 --- a/shared/source/program/kernel_info.h +++ b/shared/source/program/kernel_info.h @@ -71,7 +71,7 @@ struct KernelInfo { auto requiredWorkGroupSizeX = kernelDescriptor.kernelAttributes.requiredWorkgroupSize[0]; auto requiredWorkGroupSizeY = kernelDescriptor.kernelAttributes.requiredWorkgroupSize[1]; auto requiredWorkGroupSizeZ = kernelDescriptor.kernelAttributes.requiredWorkgroupSize[2]; - size_t maxRequiredWorkGroupSize = requiredWorkGroupSizeX * requiredWorkGroupSizeY * requiredWorkGroupSizeZ; + size_t maxRequiredWorkGroupSize = static_cast(requiredWorkGroupSizeX) * requiredWorkGroupSizeY * requiredWorkGroupSizeZ; if ((maxRequiredWorkGroupSize == 0) || (maxRequiredWorkGroupSize > maxWorkGroupSize)) { maxRequiredWorkGroupSize = maxWorkGroupSize; }