refactor: Move all constants to L0 namespace in level_zero/tools

Related-To: NEO-12769

- Use inline constexpr for declaring global variables
- Avoid using Macros
- Use string_view type instead of std::string

Signed-off-by: Harini Kumaran <harini.kumaran@intel.com>
This commit is contained in:
Harini Kumaran
2024-10-23 09:53:57 +00:00
committed by Compute-Runtime-Automation
parent f5c433c8f8
commit 421a7bd771
11 changed files with 77 additions and 73 deletions

View File

@@ -253,7 +253,7 @@ struct MockMemoryPmt : public PlatformMonitoringTech {
bool mockVfid1Status = false;
bool isRepeated = false;
void setGuid(std::string guid) {
void setGuid(std::string_view guid) {
this->guid = guid;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -620,7 +620,7 @@ TEST_F(ZesPciFixture, GivenValidSysmanHandleWhenCallingzetSysmanPciGetStatsThenV
}
TEST_F(ZesPciFixture, WhenConvertingLinkSpeedThenResultIsCorrect) {
for (int32_t i = PciGenerations::PciGen1; i <= PciGenerations::PciGen5; i++) {
for (int32_t i = static_cast<int32_t>(PciGenerations::pciGen1); i <= static_cast<int32_t>(PciGenerations::pciGen5); i++) {
double speed = convertPciGenToLinkSpeed(i);
int32_t gen = convertLinkSpeedToPciGen(speed);
EXPECT_EQ(i, gen);

View File

@@ -288,7 +288,7 @@ TEST_F(SysmanDevicePciFixture, GivenValidSysmanHandleWhenCallingGetPciStateAndSp
}
TEST_F(SysmanDevicePciFixture, WhenConvertingLinkSpeedThenResultIsCorrect) {
for (int32_t i = PciGenerations::PciGen1; i <= PciGenerations::PciGen5; i++) {
for (int32_t i = static_cast<int32_t>(PciGenerations::pciGen1); i <= static_cast<int32_t>(PciGenerations::pciGen5); i++) {
double speed = convertPciGenToLinkSpeed(i);
int32_t gen = convertLinkSpeedToPciGen(speed);
EXPECT_EQ(i, gen);