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-14 06:48:10 +00:00
committed by Compute-Runtime-Automation
parent 4fc6767119
commit 4b9a86449d
3 changed files with 4 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/debug_helpers.h"
#include "level_zero/sysman/source/shared/windows/pmt/sysman_pmt.h"
@@ -556,7 +557,7 @@ ze_result_t SysmanProductHelperHw<gfxProduct>::getMemoryBandWidth(zes_mem_bandwi
}
maxBandwidth = maxBandwidth >> 16;
pBandwidth->maxBandwidth = static_cast<uint64_t>(maxBandwidth) * mbpsToBytesPerSecond;
pBandwidth->maxBandwidth = static_cast<uint64_t>(maxBandwidth) * MemoryConstants::megaByte;
// timestamp calcuation
uint32_t timeStampL = 0;

View File

@@ -22,7 +22,7 @@ namespace Sysman {
namespace ult {
constexpr uint32_t memoryHandleComponentCount = 1u;
constexpr uint32_t mockMemoryMaxBandwidth = 250000;
constexpr uint32_t mockMemoryMaxBandwidth = 2;
constexpr uint32_t mockMemoryCurrentBandwidthRead = 3840;
constexpr uint32_t mockMemoryCurrentBandwidthWrite = 2560;
constexpr uint32_t mockMemoryBandwidthTimestamp = 1230000;

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, mockMemoryMaxBandwidth);
EXPECT_EQ(bandwidth.maxBandwidth, static_cast<uint64_t>(mockMemoryMaxBandwidth * MemoryConstants::megaByte));
EXPECT_EQ(bandwidth.readCounter, mockMemoryCurrentBandwidthRead);
EXPECT_EQ(bandwidth.writeCounter, mockMemoryCurrentBandwidthWrite);
EXPECT_EQ(bandwidth.timestamp, mockMemoryBandwidthTimestamp);