Skip to content

Commit c867a5e

Browse files
refactor: remove redundant flag levelZeroSupported
all platforms are supported by L0 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent 91a2b9e commit c867a5e

File tree

25 files changed

+25
-251
lines changed

25 files changed

+25
-251
lines changed

level_zero/core/source/driver/driver_handle_imp.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2024 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -232,9 +232,6 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
232232

233233
for (auto &neoDevice : neoDevices) {
234234
ze_result_t returnValue = ZE_RESULT_SUCCESS;
235-
if (!neoDevice->getHardwareInfo().capabilityTable.levelZeroSupported) {
236-
continue;
237-
}
238235

239236
if (this->memoryManager == nullptr) {
240237
this->memoryManager = neoDevice->getMemoryManager();

level_zero/core/test/common/ult_specific_config_l0.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2023 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -24,10 +24,6 @@ void applyWorkarounds() {
2424
}
2525
}
2626

27-
bool isPlatformSupported(const HardwareInfo &hwInfoForTests) {
28-
return L0::commandListFactory[hwInfoForTests.platform.eProductFamily] && hwInfoForTests.capabilityTable.levelZeroSupported;
29-
}
30-
3127
void setupTestFiles(std::string testBinaryFiles, int32_t revId) {
3228
std::string testBinaryFilesApiSpecific = testBinaryFiles;
3329
testBinaryFilesApiSpecific.append("/level_zero/");

level_zero/core/test/unit_tests/sources/driver/test_driver.cpp

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2024 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -465,7 +465,6 @@ TEST(DriverTestFamilySupport, whenInitializingDriverOnSupportedFamilyThenDriverI
465465

466466
ze_result_t returnValue;
467467
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
468-
hwInfo.capabilityTable.levelZeroSupported = true;
469468

470469
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
471470
NEO::DeviceVector devices;
@@ -477,24 +476,10 @@ TEST(DriverTestFamilySupport, whenInitializingDriverOnSupportedFamilyThenDriverI
477476
L0::globalDriver = nullptr;
478477
}
479478

480-
TEST(DriverTestFamilySupport, whenInitializingDriverOnNotSupportedFamilyThenDriverIsNotCreated) {
481-
ze_result_t returnValue;
482-
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
483-
hwInfo.capabilityTable.levelZeroSupported = false;
484-
485-
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
486-
NEO::DeviceVector devices;
487-
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
488-
489-
auto driverHandle = DriverHandle::create(std::move(devices), L0EnvVariables{}, &returnValue);
490-
EXPECT_EQ(nullptr, driverHandle);
491-
}
492-
493479
TEST(DriverTest, givenNullEnvVariableWhenCreatingDriverThenEnableProgramDebuggingIsFalse) {
494480

495481
ze_result_t returnValue;
496482
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
497-
hwInfo.capabilityTable.levelZeroSupported = true;
498483

499484
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
500485
NEO::DeviceVector devices;
@@ -534,7 +519,6 @@ TEST_F(DriverImpTest, givenDriverImpWhenInitializedThenEnvVariablesAreRead) {
534519
TEST_F(DriverImpTest, givenMissingMetricApiDependenciesWhenInitializingDriverImpThenGlobalDriverHandleIsNull) {
535520

536521
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
537-
hwInfo.capabilityTable.levelZeroSupported = true;
538522

539523
NEO::MockExecutionEnvironment mockExecutionEnvironment;
540524
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<NEO::ProductHelper>();
@@ -776,7 +760,6 @@ TEST(DriverTest, givenProgramDebuggingEnvVarValue1WhenCreatingDriverThenEnablePr
776760

777761
ze_result_t returnValue;
778762
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
779-
hwInfo.capabilityTable.levelZeroSupported = true;
780763

781764
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
782765
NEO::DeviceVector devices;
@@ -798,7 +781,6 @@ TEST(DriverTest, givenProgramDebuggingEnvVarValue2WhenCreatingDriverThenEnablePr
798781

799782
ze_result_t returnValue;
800783
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
801-
hwInfo.capabilityTable.levelZeroSupported = true;
802784

803785
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
804786
NEO::DeviceVector devices;
@@ -822,7 +804,6 @@ TEST(DriverTest, givenBuiltinsAsyncInitEnabledWhenCreatingDriverThenMakeSureBuil
822804

823805
ze_result_t returnValue;
824806
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
825-
hwInfo.capabilityTable.levelZeroSupported = true;
826807

827808
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
828809

@@ -890,47 +871,6 @@ TEST(DriverTest, givenInvalidCompilerEnvironmentAndEnableProgramDebuggingWithVal
890871
ASSERT_EQ(nullptr, L0::globalDriver);
891872
}
892873

893-
struct DriverTestMultipleFamilySupport : public ::testing::Test {
894-
void SetUp() override {
895-
896-
VariableBackup<bool> mockDeviceFlagBackup(&NEO::MockDevice::createSingleDevice, false);
897-
898-
deviceFactory = std::make_unique<UltDeviceFactory>(numRootDevices, numSubDevices);
899-
for (auto i = 0u; i < numRootDevices; i++) {
900-
devices.push_back(std::unique_ptr<NEO::Device>(deviceFactory->rootDevices[i]));
901-
if (i < numSupportedRootDevices) {
902-
devices[i]->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.levelZeroSupported = true;
903-
} else {
904-
deviceFactory->rootDevices.erase(deviceFactory->rootDevices.begin() + i);
905-
devices[i]->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.levelZeroSupported = false;
906-
}
907-
}
908-
}
909-
DebugManagerStateRestore restorer;
910-
std::vector<std::unique_ptr<NEO::Device>> devices;
911-
std::unique_ptr<UltDeviceFactory> deviceFactory;
912-
const uint32_t numRootDevices = 3u;
913-
const uint32_t numSubDevices = 2u;
914-
const uint32_t numSupportedRootDevices = 2u;
915-
};
916-
917-
TEST_F(DriverTestMultipleFamilySupport, whenInitializingDriverWithArrayOfDevicesThenDriverIsInitializedOnlyWithThoseSupported) {
918-
919-
ze_result_t returnValue;
920-
auto driverHandle = DriverHandle::create(std::move(devices), L0EnvVariables{}, &returnValue);
921-
EXPECT_NE(nullptr, driverHandle);
922-
923-
L0::DriverHandleImp *driverHandleImp = reinterpret_cast<L0::DriverHandleImp *>(driverHandle);
924-
EXPECT_EQ(numSupportedRootDevices, driverHandleImp->devices.size());
925-
926-
for (auto d : driverHandleImp->devices) {
927-
EXPECT_TRUE(d->getNEODevice()->getHardwareInfo().capabilityTable.levelZeroSupported);
928-
}
929-
930-
delete driverHandle;
931-
L0::globalDriver = nullptr;
932-
}
933-
934874
TEST(MultiRootDeviceDriverTest, whenInitializingDriverHandleWithMultipleDevicesThenOrderInRootDeviceIndicesMatchesOrderInDeviceVector) {
935875
Mock<DriverHandle> driverHandle;
936876
for (auto &device : driverHandle.devices) {
@@ -972,37 +912,6 @@ TEST(MultiSubDeviceDriverTest, whenInitializingDriverHandleWithMultipleDevicesWi
972912
EXPECT_EQ(0u, driverHandle.rootDeviceIndices[0]);
973913
}
974914

975-
struct DriverTestMultipleFamilyNoSupport : public ::testing::Test {
976-
void SetUp() override {
977-
978-
VariableBackup<bool> mockDeviceFlagBackup(&NEO::MockDevice::createSingleDevice, false);
979-
980-
NEO::ExecutionEnvironment *executionEnvironment = new NEO::ExecutionEnvironment();
981-
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
982-
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
983-
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
984-
executionEnvironment->rootDeviceEnvironments[i]->initGmm();
985-
}
986-
987-
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
988-
devices.push_back(std::unique_ptr<NEO::MockDevice>(NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), executionEnvironment, i)));
989-
devices[i]->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.levelZeroSupported = false;
990-
}
991-
}
992-
993-
DebugManagerStateRestore restorer;
994-
std::vector<std::unique_ptr<NEO::Device>> devices;
995-
996-
const uint32_t numRootDevices = 3u;
997-
};
998-
999-
TEST_F(DriverTestMultipleFamilyNoSupport, whenInitializingDriverWithArrayOfNotSupportedDevicesThenDriverIsNull) {
1000-
1001-
ze_result_t returnValue;
1002-
auto driverHandle = DriverHandle::create(std::move(devices), L0EnvVariables{}, &returnValue);
1003-
EXPECT_EQ(nullptr, driverHandle);
1004-
}
1005-
1006915
struct MaskArray {
1007916
const std::string masks[4] = {"0", "1", "2", "3"}; // fixture has 4 subDevices
1008917
};
@@ -1012,7 +921,6 @@ struct DriverHandleTest : public ::testing::Test {
1012921

1013922
ze_result_t returnValue;
1014923
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
1015-
hwInfo.capabilityTable.levelZeroSupported = true;
1016924

1017925
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
1018926
NEO::DeviceVector devices;

level_zero/sysman/source/driver/sysman_driver_handle_imp.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2024 Intel Corporation
2+
* Copyright (C) 2023-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -30,9 +30,6 @@ SysmanDriverHandleImp::SysmanDriverHandleImp() = default;
3030

3131
ze_result_t SysmanDriverHandleImp::initialize(NEO::ExecutionEnvironment &executionEnvironment) {
3232
for (uint32_t rootDeviceIndex = 0u; rootDeviceIndex < executionEnvironment.rootDeviceEnvironments.size(); rootDeviceIndex++) {
33-
if (!executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo()->capabilityTable.levelZeroSupported) {
34-
continue;
35-
}
3633
auto pSysmanDevice = SysmanDevice::create(executionEnvironment, rootDeviceIndex);
3734
if (pSysmanDevice != nullptr) {
3835
this->sysmanDevices.push_back(pSysmanDevice);

level_zero/sysman/test/unit_tests/sources/linux/test_sysman_driver.cpp

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2023-2024 Intel Corporation
2+
* Copyright (C) 2023-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -68,87 +68,12 @@ TEST(zesInit, whenCallingZesDriverGetWithoutZesInitThenZesDriverGetCallNotSuccee
6868
EXPECT_EQ(ZE_RESULT_ERROR_UNINITIALIZED, zesDriverGet(&count, nullptr));
6969
}
7070

71-
struct SysmanDriverTestMultipleFamilySupport : public ::testing::Test {
72-
void SetUp() override {
73-
executionEnvironment = new NEO::ExecutionEnvironment();
74-
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
75-
for (auto i = 0u; i < numRootDevices; i++) {
76-
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
77-
executionEnvironment->rootDeviceEnvironments[i]->osInterface = std::make_unique<NEO::OSInterface>();
78-
executionEnvironment->rootDeviceEnvironments[i]->osInterface->setDriverModel(std::make_unique<SysmanMockDrm>(*executionEnvironment->rootDeviceEnvironments[i]));
79-
if (i < numSupportedRootDevices) {
80-
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.levelZeroSupported = true;
81-
} else {
82-
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.levelZeroSupported = false;
83-
}
84-
}
85-
}
86-
87-
NEO::ExecutionEnvironment *executionEnvironment = nullptr;
88-
const uint32_t numRootDevices = 3u;
89-
const uint32_t numSubDevices = 2u;
90-
const uint32_t numSupportedRootDevices = 2u;
91-
};
92-
93-
TEST_F(SysmanDriverTestMultipleFamilySupport, whenInitializingSysmanDriverWithArrayOfDevicesThenDriverIsInitializedOnlyWithThoseSupported) {
94-
VariableBackup<decltype(NEO::SysCalls::sysCallsRealpath)> mockRealPath(&NEO::SysCalls::sysCallsRealpath, [](const char *path, char *buf) -> char * {
95-
constexpr size_t sizeofPath = sizeof("/sys/devices/pci0000:00/0000:00:02.0");
96-
strcpy_s(buf, sizeofPath, "/sys/devices/pci0000:00/0000:00:02.0");
97-
return buf;
98-
});
99-
100-
VariableBackup<decltype(NEO::SysCalls::sysCallsReadlink)> mockReadLink(&NEO::SysCalls::sysCallsReadlink, [](const char *path, char *buf, size_t bufsize) -> int {
101-
std::string str = "../../devices/pci0000:37/0000:37:01.0/0000:38:00.0/0000:39:01.0/0000:3a:00.0/drm/renderD128";
102-
std::memcpy(buf, str.c_str(), str.size());
103-
return static_cast<int>(str.size());
104-
});
105-
106-
ze_result_t returnValue;
107-
108-
auto driverHandle = L0::Sysman::SysmanDriverHandle::create(*executionEnvironment, &returnValue);
109-
EXPECT_NE(nullptr, driverHandle);
110-
111-
L0::Sysman::SysmanDriverHandleImp *driverHandleImp = reinterpret_cast<L0::Sysman::SysmanDriverHandleImp *>(driverHandle);
112-
EXPECT_EQ(numSupportedRootDevices, driverHandleImp->sysmanDevices.size());
113-
114-
for (auto d : driverHandleImp->sysmanDevices) {
115-
EXPECT_TRUE(d->getHardwareInfo().capabilityTable.levelZeroSupported);
116-
}
117-
118-
delete driverHandle;
119-
L0::Sysman::globalSysmanDriver = nullptr;
120-
}
121-
122-
struct SysmanDriverTestMultipleFamilyNoSupport : public ::testing::Test {
123-
void SetUp() override {
124-
executionEnvironment = new NEO::ExecutionEnvironment();
125-
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
126-
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
127-
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
128-
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.levelZeroSupported = false;
129-
}
130-
}
131-
132-
NEO::ExecutionEnvironment *executionEnvironment = nullptr;
133-
const uint32_t numRootDevices = 3u;
134-
};
135-
136-
TEST_F(SysmanDriverTestMultipleFamilyNoSupport, whenInitializingSysmanDriverWithArrayOfNotSupportedDevicesThenDriverIsNull) {
137-
ze_result_t returnValue;
138-
this->executionEnvironment->incRefInternal();
139-
auto driverHandle = L0::Sysman::SysmanDriverHandle::create(*executionEnvironment, &returnValue);
140-
EXPECT_EQ(nullptr, driverHandle);
141-
EXPECT_EQ(returnValue, ZE_RESULT_ERROR_UNINITIALIZED);
142-
this->executionEnvironment->decRefInternal();
143-
}
144-
14571
struct SysmanDriverTestNoDeviceCreate : public ::testing::Test {
14672
void SetUp() override {
14773
executionEnvironment = new NEO::ExecutionEnvironment();
14874
executionEnvironment->prepareRootDeviceEnvironments(numRootDevices);
14975
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
15076
executionEnvironment->rootDeviceEnvironments[i]->setHwInfoAndInitHelpers(NEO::defaultHwInfo.get());
151-
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.levelZeroSupported = true;
15277
executionEnvironment->rootDeviceEnvironments[i]->osInterface = std::make_unique<NEO::OSInterface>();
15378
executionEnvironment->rootDeviceEnvironments[i]->osInterface->setDriverModel(std::make_unique<SysmanMockDrm>(*executionEnvironment->rootDeviceEnvironments[i]));
15479
}

opencl/test/unit_test/ult_specific_config_ocl.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018-2023 Intel Corporation
2+
* Copyright (C) 2018-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -23,10 +23,6 @@ void cleanTestHelpers() {
2323
delete platformsImpl;
2424
}
2525

26-
bool isPlatformSupported(const HardwareInfo &hwInfoForTests) {
27-
return true;
28-
}
29-
3026
void setupTestFiles(std::string testBinaryFiles, int32_t revId) {
3127
testBinaryFiles.append("/");
3228
testBinaryFiles.append(binaryNameSuffix);

shared/source/gen12lp/hw_info_adln.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2024 Intel Corporation
2+
* Copyright (C) 2022-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,7 +72,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
7272
false, // supportsOnDemandPageFaults
7373
false, // supportsIndependentForwardProgress
7474
false, // hostPtrTrackingEnabled
75-
true, // levelZeroSupported
7675
true, // isIntegratedDevice
7776
true, // supportsMediaBlock
7877
false, // p2pAccessSupported

shared/source/gen12lp/hw_info_adlp.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021-2024 Intel Corporation
2+
* Copyright (C) 2021-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,7 +72,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
7272
false, // supportsOnDemandPageFaults
7373
false, // supportsIndependentForwardProgress
7474
false, // hostPtrTrackingEnabled
75-
true, // levelZeroSupported
7675
true, // isIntegratedDevice
7776
true, // supportsMediaBlock
7877
false, // p2pAccessSupported

shared/source/gen12lp/hw_info_adls.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2024 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,7 +72,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
7272
false, // supportsOnDemandPageFaults
7373
false, // supportsIndependentForwardProgress
7474
false, // hostPtrTrackingEnabled
75-
true, // levelZeroSupported
7675
true, // isIntegratedDevice
7776
true, // supportsMediaBlock
7877
false, // p2pAccessSupported

shared/source/gen12lp/hw_info_dg1.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2024 Intel Corporation
2+
* Copyright (C) 2020-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -72,7 +72,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{
7272
false, // supportsOnDemandPageFaults
7373
false, // supportsIndependentForwardProgress
7474
false, // hostPtrTrackingEnabled
75-
true, // levelZeroSupported
7675
false, // isIntegratedDevice
7776
true, // supportsMediaBlock
7877
true, // p2pAccessSupported

0 commit comments

Comments
 (0)