mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
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:
committed by
Compute-Runtime-Automation
parent
fbabe203c1
commit
484684c762
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user