fix: Correct maxBandwidth unit conversation in pmt

Related-To: NEO-12297

Signed-off-by: shubham kumar <shubham.kumar@intel.com>
This commit is contained in:
shubham kumar
2024-08-31 05:11:12 +00:00
committed by Compute-Runtime-Automation
parent fbabe203c1
commit 484684c762
3 changed files with 3 additions and 3 deletions

View File

@@ -5,7 +5,6 @@
*
*/
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/debug_helpers.h"
#include "level_zero/sysman/source/shared/windows/pmt/sysman_pmt.h"
@@ -567,7 +566,7 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandWidth(zes_mem_bandwi
maxBandwidth = maxBandwidth >> 16;
// PMT reports maxBandwidth in units of 100 MBps. Need to convert it into Bytes/sec, unit to be returned by sysman.
pBandwidth->maxBandwidth = static_cast<uint64_t>(maxBandwidth) * MemoryConstants::megaByte * 100;
pBandwidth->maxBandwidth = static_cast<uint64_t>(maxBandwidth) * megaBytesToBytes * 100;
// timestamp calcuation
uint32_t timeStampL = 0;

View File

@@ -76,6 +76,7 @@ constexpr uint16_t milliSecsToMicroSecs = 1000;
constexpr uint32_t milliFactor = 1000u;
constexpr uint32_t microFactor = milliFactor * milliFactor;
constexpr uint64_t gigaUnitTransferToUnitTransfer = 1000 * 1000 * 1000;
constexpr uint64_t megaBytesToBytes = 1000 * 1000;
constexpr int32_t memoryBusWidth = 128; // bus width in bytes
constexpr int32_t numMemoryChannels = 8;

View File

@@ -143,7 +143,7 @@ HWTEST2_F(SysmanDeviceMemoryHelperFixture, GivenValidMemoryHandleWhenGettingBand
ze_result_t result = zesMemoryGetBandwidth(handle, &bandwidth);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
EXPECT_EQ(bandwidth.maxBandwidth, static_cast<uint64_t>(mockMemoryMaxBandwidth * MemoryConstants::megaByte * 100));
EXPECT_EQ(bandwidth.maxBandwidth, static_cast<uint64_t>(mockMemoryMaxBandwidth * megaBytesToBytes * 100));
EXPECT_EQ(bandwidth.readCounter, mockMemoryCurrentBandwidthRead);
EXPECT_EQ(bandwidth.writeCounter, mockMemoryCurrentBandwidthWrite);
EXPECT_EQ(bandwidth.timestamp, mockMemoryBandwidthTimestamp);