refactor: correct variable naming
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
87247e6949
commit
4fca0e16b6
|
@ -193,7 +193,7 @@ ze_result_t LinuxMemoryImp::getBandwidthForDg2(zes_mem_bandwidth_t *pBandwidth)
|
|||
if (result != ZE_RESULT_SUCCESS) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s():pSysfsAccess->read returning error:0x%x \n", __FUNCTION__, result);
|
||||
}
|
||||
pBandwidth->maxBandwidth = maxBw * MbpsToBytesPerSecond;
|
||||
pBandwidth->maxBandwidth = maxBw * mbpsToBytesPerSecond;
|
||||
pBandwidth->timestamp = SysmanDevice::getSysmanTimestamp();
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ ze_result_t WddmMemoryImp::getBandwidth(zes_mem_bandwidth_t *pBandwidth) {
|
|||
pBandwidth->maxBandwidth = 0;
|
||||
if (vResponses[0].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu32, sizeof(uint32_t), vResponses[0].dataBuffer, sizeof(uint32_t));
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(MbpsToBytesPerSecond);
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(mbpsToBytesPerSecond);
|
||||
}
|
||||
|
||||
pBandwidth->readCounter = 0;
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace Sysman {
|
|||
//
|
||||
int64_t convertPcieSpeedFromGTsToBs(double maxLinkSpeedInGt) {
|
||||
double pcieSpeedWithEnc;
|
||||
if ((maxLinkSpeedInGt == PciLinkSpeeds::Pci32_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci16_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci8_0GigatransfersPerSecond)) {
|
||||
if ((maxLinkSpeedInGt == PciLinkSpeeds::pci32GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci16GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci8GigaTransfersPerSecond)) {
|
||||
pcieSpeedWithEnc = maxLinkSpeedInGt * 1000 * 128 / 130;
|
||||
} else if ((maxLinkSpeedInGt == PciLinkSpeeds::Pci5_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci2_5GigatransfersPerSecond)) {
|
||||
} else if ((maxLinkSpeedInGt == PciLinkSpeeds::pci5GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond)) {
|
||||
pcieSpeedWithEnc = maxLinkSpeedInGt * 1000 * 8 / 10;
|
||||
} else {
|
||||
pcieSpeedWithEnc = 0;
|
||||
|
@ -50,19 +50,19 @@ int64_t convertPcieSpeedFromGTsToBs(double maxLinkSpeedInGt) {
|
|||
double convertPciGenToLinkSpeed(uint32_t gen) {
|
||||
switch (gen) {
|
||||
case PciGenerations::PciGen1: {
|
||||
return PciLinkSpeeds::Pci2_5GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen2: {
|
||||
return PciLinkSpeeds::Pci5_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci5GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen3: {
|
||||
return PciLinkSpeeds::Pci8_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci8GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen4: {
|
||||
return PciLinkSpeeds::Pci16_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci16GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen5: {
|
||||
return PciLinkSpeeds::Pci32_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci32GigaTransfersPerSecond;
|
||||
} break;
|
||||
default: {
|
||||
return 0.0;
|
||||
|
@ -71,15 +71,15 @@ double convertPciGenToLinkSpeed(uint32_t gen) {
|
|||
}
|
||||
|
||||
int32_t convertLinkSpeedToPciGen(double speed) {
|
||||
if (speed == PciLinkSpeeds::Pci2_5GigatransfersPerSecond) {
|
||||
if (speed == PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen1;
|
||||
} else if (speed == PciLinkSpeeds::Pci5_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci5GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen2;
|
||||
} else if (speed == PciLinkSpeeds::Pci8_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci8GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen3;
|
||||
} else if (speed == PciLinkSpeeds::Pci16_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci16GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen4;
|
||||
} else if (speed == PciLinkSpeeds::Pci32_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci32GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen5;
|
||||
} else {
|
||||
return -1;
|
||||
|
|
|
@ -12,7 +12,7 @@ const std::string vendorIntel("Intel(R) Corporation");
|
|||
const std::string unknown("unknown");
|
||||
const std::string intelPciId("0x8086");
|
||||
const std::string guid64BitMemoryCounters("0xb15a0ede");
|
||||
constexpr uint32_t MbpsToBytesPerSecond = 125000;
|
||||
constexpr uint32_t mbpsToBytesPerSecond = 125000;
|
||||
constexpr double milliVoltsFactor = 1000.0;
|
||||
constexpr uint32_t maxRasErrorCategoryCount = 7;
|
||||
|
||||
|
@ -37,11 +37,11 @@ struct SteadyClock {
|
|||
} // namespace L0
|
||||
|
||||
namespace PciLinkSpeeds {
|
||||
constexpr double Pci2_5GigatransfersPerSecond = 2.5;
|
||||
constexpr double Pci5_0GigatransfersPerSecond = 5.0;
|
||||
constexpr double Pci8_0GigatransfersPerSecond = 8.0;
|
||||
constexpr double Pci16_0GigatransfersPerSecond = 16.0;
|
||||
constexpr double Pci32_0GigatransfersPerSecond = 32.0;
|
||||
constexpr double pci2Dot5GigaTransfersPerSecond = 2.5;
|
||||
constexpr double pci5GigaTransfersPerSecond = 5.0;
|
||||
constexpr double pci8GigaTransfersPerSecond = 8.0;
|
||||
constexpr double pci16GigaTransfersPerSecond = 16.0;
|
||||
constexpr double pci32GigaTransfersPerSecond = 32.0;
|
||||
|
||||
} // namespace PciLinkSpeeds
|
||||
enum PciGenerations {
|
||||
|
|
|
@ -572,7 +572,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
|
|||
EXPECT_EQ(expectedReadCounters, bandwidth.readCounter);
|
||||
expectedWriteCounters = numberMcChannels * mockIdiWriteVal * transactionSize;
|
||||
EXPECT_EQ(expectedWriteCounters, bandwidth.writeCounter);
|
||||
expectedBandwidth = mockMaxBwDg2 * MbpsToBytesPerSecond;
|
||||
expectedBandwidth = mockMaxBwDg2 * mbpsToBytesPerSecond;
|
||||
EXPECT_EQ(expectedBandwidth, bandwidth.maxBandwidth);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ TEST_F(SysmanDeviceMemoryFixture, DISABLED_GivenValidMemoryHandleWhenGettingBand
|
|||
ze_result_t result = zesMemoryGetBandwidth(handle, &bandwidth);
|
||||
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, pKmdSysManager->mockMemoryMaxBandwidth * MbpsToBytesPerSecond);
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, pKmdSysManager->mockMemoryMaxBandwidth * mbpsToBytesPerSecond);
|
||||
EXPECT_EQ(bandwidth.readCounter, pKmdSysManager->mockMemoryCurrentBandwidthRead);
|
||||
EXPECT_EQ(bandwidth.writeCounter, pKmdSysManager->mockMemoryCurrentBandwidthWrite);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
|
|
|
@ -610,17 +610,17 @@ TEST_F(ZesPciFixture, WhenConvertingLinkSpeedThenResultIsCorrect) {
|
|||
// maxLinkSpeedInGt * (Gigabit to Megabit) * Encoding * (Mb/s to bytes/second) =
|
||||
// maxLinkSpeedInGt * convertGigabitToMegabit * Encoding * convertMegabitsPerSecondToBytesPerSecond;
|
||||
|
||||
TEST_F(ZesPciFixture, WhenConvertingLinkSpeedFromGigatransfersPerSecondToBytesPerSecondThenResultIsCorrect) {
|
||||
int64_t speedPci320 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci32_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci320, static_cast<int64_t>(PciLinkSpeeds::Pci32_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci160 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci16_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci160, static_cast<int64_t>(PciLinkSpeeds::Pci16_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci80 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci8_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci80, static_cast<int64_t>(PciLinkSpeeds::Pci8_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci50 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci5_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci50, static_cast<int64_t>(PciLinkSpeeds::Pci5_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
int64_t speedPci25 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci2_5GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci25, static_cast<int64_t>(PciLinkSpeeds::Pci2_5GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
TEST_F(ZesPciFixture, WhenConvertingLinkSpeedFromGigaTransfersPerSecondToBytesPerSecondThenResultIsCorrect) {
|
||||
int64_t speedPci320 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci32GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci320, static_cast<int64_t>(PciLinkSpeeds::pci32GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci160 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci16GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci160, static_cast<int64_t>(PciLinkSpeeds::pci16GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci80 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci8GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci80, static_cast<int64_t>(PciLinkSpeeds::pci8GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci50 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci5GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci50, static_cast<int64_t>(PciLinkSpeeds::pci5GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
int64_t speedPci25 = L0::Sysman::convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci25, static_cast<int64_t>(PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
EXPECT_EQ(0, L0::Sysman::convertPcieSpeedFromGTsToBs(0.0));
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ ze_result_t LinuxMemoryImp::getBandwidthForDg2(zes_mem_bandwidth_t *pBandwidth)
|
|||
if (result != ZE_RESULT_SUCCESS) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s():pSysfsAccess->read returning error:0x%x \n", __FUNCTION__, result);
|
||||
}
|
||||
pBandwidth->maxBandwidth = maxBw * MbpsToBytesPerSecond;
|
||||
pBandwidth->maxBandwidth = maxBw * mbpsToBytesPerSecond;
|
||||
pBandwidth->timestamp = SysmanDevice::getSysmanTimestamp();
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ ze_result_t WddmMemoryImp::getBandwidth(zes_mem_bandwidth_t *pBandwidth) {
|
|||
pBandwidth->maxBandwidth = 0;
|
||||
if (vResponses[0].returnCode == KmdSysman::Success) {
|
||||
memcpy_s(&retValu32, sizeof(uint32_t), vResponses[0].dataBuffer, sizeof(uint32_t));
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(MbpsToBytesPerSecond);
|
||||
pBandwidth->maxBandwidth = static_cast<uint64_t>(retValu32) * static_cast<uint64_t>(mbpsToBytesPerSecond);
|
||||
}
|
||||
|
||||
pBandwidth->readCounter = 0;
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace L0 {
|
|||
//
|
||||
int64_t convertPcieSpeedFromGTsToBs(double maxLinkSpeedInGt) {
|
||||
double pcieSpeedWithEnc;
|
||||
if ((maxLinkSpeedInGt == PciLinkSpeeds::Pci32_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci16_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci8_0GigatransfersPerSecond)) {
|
||||
if ((maxLinkSpeedInGt == PciLinkSpeeds::pci32GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci16GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci8GigaTransfersPerSecond)) {
|
||||
pcieSpeedWithEnc = maxLinkSpeedInGt * 1000 * 128 / 130;
|
||||
} else if ((maxLinkSpeedInGt == PciLinkSpeeds::Pci5_0GigatransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::Pci2_5GigatransfersPerSecond)) {
|
||||
} else if ((maxLinkSpeedInGt == PciLinkSpeeds::pci5GigaTransfersPerSecond) || (maxLinkSpeedInGt == PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond)) {
|
||||
pcieSpeedWithEnc = maxLinkSpeedInGt * 1000 * 8 / 10;
|
||||
} else {
|
||||
pcieSpeedWithEnc = 0;
|
||||
|
@ -49,19 +49,19 @@ int64_t convertPcieSpeedFromGTsToBs(double maxLinkSpeedInGt) {
|
|||
double convertPciGenToLinkSpeed(uint32_t gen) {
|
||||
switch (gen) {
|
||||
case PciGenerations::PciGen1: {
|
||||
return PciLinkSpeeds::Pci2_5GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen2: {
|
||||
return PciLinkSpeeds::Pci5_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci5GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen3: {
|
||||
return PciLinkSpeeds::Pci8_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci8GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen4: {
|
||||
return PciLinkSpeeds::Pci16_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci16GigaTransfersPerSecond;
|
||||
} break;
|
||||
case PciGenerations::PciGen5: {
|
||||
return PciLinkSpeeds::Pci32_0GigatransfersPerSecond;
|
||||
return PciLinkSpeeds::pci32GigaTransfersPerSecond;
|
||||
} break;
|
||||
default: {
|
||||
return 0.0;
|
||||
|
@ -70,15 +70,15 @@ double convertPciGenToLinkSpeed(uint32_t gen) {
|
|||
}
|
||||
|
||||
int32_t convertLinkSpeedToPciGen(double speed) {
|
||||
if (speed == PciLinkSpeeds::Pci2_5GigatransfersPerSecond) {
|
||||
if (speed == PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen1;
|
||||
} else if (speed == PciLinkSpeeds::Pci5_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci5GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen2;
|
||||
} else if (speed == PciLinkSpeeds::Pci8_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci8GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen3;
|
||||
} else if (speed == PciLinkSpeeds::Pci16_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci16GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen4;
|
||||
} else if (speed == PciLinkSpeeds::Pci32_0GigatransfersPerSecond) {
|
||||
} else if (speed == PciLinkSpeeds::pci32GigaTransfersPerSecond) {
|
||||
return PciGenerations::PciGen5;
|
||||
} else {
|
||||
return -1;
|
||||
|
|
|
@ -12,7 +12,7 @@ const std::string vendorIntel("Intel(R) Corporation");
|
|||
const std::string unknown("unknown");
|
||||
const std::string intelPciId("0x8086");
|
||||
const std::string guid64BitMemoryCounters("0xb15a0ede");
|
||||
constexpr uint32_t MbpsToBytesPerSecond = 125000;
|
||||
constexpr uint32_t mbpsToBytesPerSecond = 125000;
|
||||
constexpr double milliVoltsFactor = 1000.0;
|
||||
constexpr uint32_t maxRasErrorCategoryCount = 7;
|
||||
namespace L0 {
|
||||
|
@ -30,11 +30,11 @@ struct SteadyClock {
|
|||
} // namespace L0
|
||||
|
||||
namespace PciLinkSpeeds {
|
||||
constexpr double Pci2_5GigatransfersPerSecond = 2.5;
|
||||
constexpr double Pci5_0GigatransfersPerSecond = 5.0;
|
||||
constexpr double Pci8_0GigatransfersPerSecond = 8.0;
|
||||
constexpr double Pci16_0GigatransfersPerSecond = 16.0;
|
||||
constexpr double Pci32_0GigatransfersPerSecond = 32.0;
|
||||
constexpr double pci2Dot5GigaTransfersPerSecond = 2.5;
|
||||
constexpr double pci5GigaTransfersPerSecond = 5.0;
|
||||
constexpr double pci8GigaTransfersPerSecond = 8.0;
|
||||
constexpr double pci16GigaTransfersPerSecond = 16.0;
|
||||
constexpr double pci32GigaTransfersPerSecond = 32.0;
|
||||
|
||||
} // namespace PciLinkSpeeds
|
||||
enum PciGenerations {
|
||||
|
|
|
@ -764,7 +764,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemo
|
|||
EXPECT_EQ(expectedReadCounters, bandwidth.readCounter);
|
||||
expectedWriteCounters = numberMcChannels * mockIdiWriteVal * transactionSize;
|
||||
EXPECT_EQ(expectedWriteCounters, bandwidth.writeCounter);
|
||||
expectedBandwidth = mockMaxBwDg2 * MbpsToBytesPerSecond;
|
||||
expectedBandwidth = mockMaxBwDg2 * mbpsToBytesPerSecond;
|
||||
EXPECT_EQ(expectedBandwidth, bandwidth.maxBandwidth);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ TEST_F(SysmanDeviceMemoryFixture, DISABLED_GivenValidMemoryHandleWhenGettingBand
|
|||
ze_result_t result = zesMemoryGetBandwidth(handle, &bandwidth);
|
||||
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, pKmdSysManager->mockMemoryMaxBandwidth * MbpsToBytesPerSecond);
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, pKmdSysManager->mockMemoryMaxBandwidth * mbpsToBytesPerSecond);
|
||||
EXPECT_EQ(bandwidth.readCounter, pKmdSysManager->mockMemoryCurrentBandwidthRead);
|
||||
EXPECT_EQ(bandwidth.writeCounter, pKmdSysManager->mockMemoryCurrentBandwidthWrite);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
|
|
|
@ -636,17 +636,17 @@ TEST_F(ZesPciFixture, WhenConvertingLinkSpeedThenResultIsCorrect) {
|
|||
// maxLinkSpeedInGt * (Gigabit to Megabit) * Encoding * (Mb/s to bytes/second) =
|
||||
// maxLinkSpeedInGt * convertGigabitToMegabit * Encoding * convertMegabitsPerSecondToBytesPerSecond;
|
||||
|
||||
TEST_F(ZesPciFixture, WhenConvertingLinkSpeedFromGigatransfersPerSecondToBytesPerSecondThenResultIsCorrect) {
|
||||
int64_t speedPci320 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci32_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci320, static_cast<int64_t>(PciLinkSpeeds::Pci32_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci160 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci16_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci160, static_cast<int64_t>(PciLinkSpeeds::Pci16_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci80 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci8_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci80, static_cast<int64_t>(PciLinkSpeeds::Pci8_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci50 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci5_0GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci50, static_cast<int64_t>(PciLinkSpeeds::Pci5_0GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
int64_t speedPci25 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::Pci2_5GigatransfersPerSecond);
|
||||
EXPECT_EQ(speedPci25, static_cast<int64_t>(PciLinkSpeeds::Pci2_5GigatransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
TEST_F(ZesPciFixture, WhenConvertingLinkSpeedFromGigaTransfersPerSecondToBytesPerSecondThenResultIsCorrect) {
|
||||
int64_t speedPci320 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci32GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci320, static_cast<int64_t>(PciLinkSpeeds::pci32GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci160 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci16GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci160, static_cast<int64_t>(PciLinkSpeeds::pci16GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci80 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci8GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci80, static_cast<int64_t>(PciLinkSpeeds::pci8GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen3andAbove));
|
||||
int64_t speedPci50 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci5GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci50, static_cast<int64_t>(PciLinkSpeeds::pci5GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
int64_t speedPci25 = convertPcieSpeedFromGTsToBs(PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond);
|
||||
EXPECT_EQ(speedPci25, static_cast<int64_t>(PciLinkSpeeds::pci2Dot5GigaTransfersPerSecond * convertMegabitsPerSecondToBytesPerSecond * convertGigabitToMegabit * encodingGen1Gen2));
|
||||
EXPECT_EQ(0, convertPcieSpeedFromGTsToBs(0.0));
|
||||
}
|
||||
TEST_F(SysmanDeviceFixture, GivenValidSysmanHandleWhenCallingzesSysmanPciGetStateThenVerifyzetSysmanPciGetStatsCallReturnNotSupported) {
|
||||
|
|
Loading…
Reference in New Issue