1
1
/*
2
- * Copyright (C) 2020-2024 Intel Corporation
2
+ * Copyright (C) 2020-2025 Intel Corporation
3
3
*
4
4
* SPDX-License-Identifier: MIT
5
5
*
@@ -465,7 +465,6 @@ TEST(DriverTestFamilySupport, whenInitializingDriverOnSupportedFamilyThenDriverI
465
465
466
466
ze_result_t returnValue;
467
467
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
468
- hwInfo.capabilityTable .levelZeroSupported = true ;
469
468
470
469
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
471
470
NEO::DeviceVector devices;
@@ -477,24 +476,10 @@ TEST(DriverTestFamilySupport, whenInitializingDriverOnSupportedFamilyThenDriverI
477
476
L0::globalDriver = nullptr ;
478
477
}
479
478
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
-
493
479
TEST (DriverTest, givenNullEnvVariableWhenCreatingDriverThenEnableProgramDebuggingIsFalse) {
494
480
495
481
ze_result_t returnValue;
496
482
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
497
- hwInfo.capabilityTable .levelZeroSupported = true ;
498
483
499
484
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
500
485
NEO::DeviceVector devices;
@@ -534,7 +519,6 @@ TEST_F(DriverImpTest, givenDriverImpWhenInitializedThenEnvVariablesAreRead) {
534
519
TEST_F (DriverImpTest, givenMissingMetricApiDependenciesWhenInitializingDriverImpThenGlobalDriverHandleIsNull) {
535
520
536
521
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
537
- hwInfo.capabilityTable .levelZeroSupported = true ;
538
522
539
523
NEO::MockExecutionEnvironment mockExecutionEnvironment;
540
524
const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments [0 ]->getHelper <NEO::ProductHelper>();
@@ -776,7 +760,6 @@ TEST(DriverTest, givenProgramDebuggingEnvVarValue1WhenCreatingDriverThenEnablePr
776
760
777
761
ze_result_t returnValue;
778
762
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
779
- hwInfo.capabilityTable .levelZeroSupported = true ;
780
763
781
764
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
782
765
NEO::DeviceVector devices;
@@ -798,7 +781,6 @@ TEST(DriverTest, givenProgramDebuggingEnvVarValue2WhenCreatingDriverThenEnablePr
798
781
799
782
ze_result_t returnValue;
800
783
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
801
- hwInfo.capabilityTable .levelZeroSupported = true ;
802
784
803
785
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
804
786
NEO::DeviceVector devices;
@@ -822,7 +804,6 @@ TEST(DriverTest, givenBuiltinsAsyncInitEnabledWhenCreatingDriverThenMakeSureBuil
822
804
823
805
ze_result_t returnValue;
824
806
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
825
- hwInfo.capabilityTable .levelZeroSupported = true ;
826
807
827
808
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
828
809
@@ -890,47 +871,6 @@ TEST(DriverTest, givenInvalidCompilerEnvironmentAndEnableProgramDebuggingWithVal
890
871
ASSERT_EQ (nullptr , L0::globalDriver);
891
872
}
892
873
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
-
934
874
TEST (MultiRootDeviceDriverTest, whenInitializingDriverHandleWithMultipleDevicesThenOrderInRootDeviceIndicesMatchesOrderInDeviceVector) {
935
875
Mock<DriverHandle> driverHandle;
936
876
for (auto &device : driverHandle.devices ) {
@@ -972,37 +912,6 @@ TEST(MultiSubDeviceDriverTest, whenInitializingDriverHandleWithMultipleDevicesWi
972
912
EXPECT_EQ (0u , driverHandle.rootDeviceIndices [0 ]);
973
913
}
974
914
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
-
1006
915
struct MaskArray {
1007
916
const std::string masks[4 ] = {" 0" , " 1" , " 2" , " 3" }; // fixture has 4 subDevices
1008
917
};
@@ -1012,7 +921,6 @@ struct DriverHandleTest : public ::testing::Test {
1012
921
1013
922
ze_result_t returnValue;
1014
923
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get ();
1015
- hwInfo.capabilityTable .levelZeroSupported = true ;
1016
924
1017
925
NEO::MockDevice *neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo);
1018
926
NEO::DeviceVector devices;
0 commit comments