mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Update mechanism for retrieving timestamp for Sysman memory
Related-To: LOCI-3679 Signed-off-by: Mayank Raghuwanshi <mayank.raghuwanshi@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c275008e51
commit
52593fd4f4
@@ -81,7 +81,6 @@ constexpr uint64_t mockIdiWriteVal = 9u;
|
||||
constexpr uint64_t mockDisplayVc1ReadVal = 10u;
|
||||
constexpr uint64_t numberMcChannels = 16;
|
||||
constexpr uint64_t transactionSize = 32;
|
||||
constexpr uint64_t mcTimeStamp = 62000000000u;
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
@@ -395,8 +394,6 @@ struct MockMemoryPmt : public PlatformMonitoringTech {
|
||||
val = mockIdiWriteVal;
|
||||
} else if (key.compare("DISPLAY_VC1_READS[0]") == 0 || key.compare("DISPLAY_VC1_READS[1]") == 0 || key.compare("DISPLAY_VC1_READS[2]") == 0 || key.compare("DISPLAY_VC1_READS[3]") == 0 || key.compare("DISPLAY_VC1_READS[4]") == 0 || key.compare("DISPLAY_VC1_READS[5]") == 0 || key.compare("DISPLAY_VC1_READS[6]") == 0 || key.compare("DISPLAY_VC1_READS[7]") == 0 || key.compare("DISPLAY_VC1_READS[8]") == 0 || key.compare("DISPLAY_VC1_READS[9]") == 0 || key.compare("DISPLAY_VC1_READS[10]") == 0 || key.compare("DISPLAY_VC1_READS[11]") == 0 || key.compare("DISPLAY_VC1_READS[12]") == 0 || key.compare("DISPLAY_VC1_READS[13]") == 0 || key.compare("DISPLAY_VC1_READS[14]") == 0 || key.compare("DISPLAY_VC1_READS[15]") == 0) {
|
||||
val = mockDisplayVc1ReadVal;
|
||||
} else if (key.compare("MC_CAPTURE_TIMESTAMP") == 0) {
|
||||
val = mcTimeStamp;
|
||||
} else {
|
||||
result = ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
@@ -434,8 +431,6 @@ struct MockMemoryPmt : public PlatformMonitoringTech {
|
||||
val = mockIdiWriteVal;
|
||||
} else if (key.compare("DISPLAY_VC1_READS[0]") == 0 || key.compare("DISPLAY_VC1_READS[1]") == 0 || key.compare("DISPLAY_VC1_READS[2]") == 0 || key.compare("DISPLAY_VC1_READS[3]") == 0 || key.compare("DISPLAY_VC1_READS[4]") == 0 || key.compare("DISPLAY_VC1_READS[5]") == 0 || key.compare("DISPLAY_VC1_READS[6]") == 0 || key.compare("DISPLAY_VC1_READS[7]") == 0 || key.compare("DISPLAY_VC1_READS[8]") == 0 || key.compare("DISPLAY_VC1_READS[9]") == 0 || key.compare("DISPLAY_VC1_READS[10]") == 0 || key.compare("DISPLAY_VC1_READS[11]") == 0 || key.compare("DISPLAY_VC1_READS[12]") == 0 || key.compare("DISPLAY_VC1_READS[13]") == 0 || key.compare("DISPLAY_VC1_READS[14]") == 0 || key.compare("DISPLAY_VC1_READS[15]") == 0) {
|
||||
val = mockDisplayVc1ReadVal;
|
||||
} else if (key.compare("MC_CAPTURE_TIMESTAMP") == 0) {
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
@@ -496,12 +496,10 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
|
||||
zesMemoryGetProperties(handle, &properties);
|
||||
|
||||
zes_mem_bandwidth_t bandwidth;
|
||||
uint64_t expectedReadCounters = 0, expectedWriteCounters = 0;
|
||||
uint64_t expectedTimestamp = 0, expectedBandwidth = 0;
|
||||
uint64_t expectedReadCounters = 0, expectedWriteCounters = 0, expectedBandwidth = 0;
|
||||
uint64_t mockMaxBwDg2 = 1343616u;
|
||||
pSysfsAccess->mockReadUInt64Value.push_back(mockMaxBwDg2);
|
||||
pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS);
|
||||
|
||||
EXPECT_EQ(zesMemoryGetBandwidth(handle, &bandwidth), ZE_RESULT_SUCCESS);
|
||||
expectedReadCounters = numberMcChannels * (mockIdiReadVal + mockDisplayVc1ReadVal) * transactionSize;
|
||||
EXPECT_EQ(expectedReadCounters, bandwidth.readCounter);
|
||||
@@ -509,8 +507,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
|
||||
EXPECT_EQ(expectedWriteCounters, bandwidth.writeCounter);
|
||||
expectedBandwidth = mockMaxBwDg2 * MbpsToBytesPerSecond;
|
||||
EXPECT_EQ(expectedBandwidth, bandwidth.maxBandwidth);
|
||||
expectedTimestamp = mcTimeStamp * 1e-8;
|
||||
EXPECT_EQ(expectedTimestamp, bandwidth.timestamp);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,25 +600,6 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthForDg2PlatformIfTimeStampReadFailsTheFailureIsReturned) {
|
||||
setLocalSupportedAndReinit(true);
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.platform.eProductFamily = IGFX_DG2;
|
||||
pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getRootDeviceEnvironmentRef().setHwInfoAndInitHelpers(&hwInfo);
|
||||
auto handles = getMemoryHandles(memoryHandleComponentCount);
|
||||
|
||||
for (auto handle : handles) {
|
||||
zes_mem_properties_t properties = {};
|
||||
zesMemoryGetProperties(handle, &properties);
|
||||
|
||||
zes_mem_bandwidth_t bandwidth;
|
||||
|
||||
auto pPmt = static_cast<MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId));
|
||||
pPmt->mockReadTimeStampFailureReturnStatus = ZE_RESULT_ERROR_UNKNOWN;
|
||||
EXPECT_EQ(zesMemoryGetBandwidth(handle, &bandwidth), ZE_RESULT_ERROR_UNKNOWN);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceMemoryFixture, GivenCallinggetHbmFrequencyWhenProductFamilyIsPVCForSteppingIsBAndOnSubDeviceThenHbmFrequencyShouldNotBeZero) {
|
||||
PublicLinuxMemoryImp *pLinuxMemoryImp = new PublicLinuxMemoryImp(pOsSysman, true, 1);
|
||||
uint64_t hbmFrequency = 0;
|
||||
|
||||
Reference in New Issue
Block a user