diff --git a/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp b/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp index f248b17f1b..e09d8ad624 100644 --- a/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp +++ b/level_zero/core/test/unit_tests/fixtures/device_fixture.cpp @@ -96,7 +96,7 @@ void MultiDeviceFixture::tearDown() { } void MultipleDevicesWithCustomHwInfo::setUp() { - NEO::MockCompilerEnableGuard mock(true); + VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); std::vector> devices; @@ -151,7 +151,6 @@ void SingleRootMultiSubDeviceFixture::setUp() { neoDevice = device->getNEODevice(); } void SingleRootMultiSubDeviceFixtureWithImplicitScalingImpl::setUp() { - DebugManagerStateRestore restorer; DebugManager.flags.EnableImplicitScaling.set(implicitScaling); DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices); @@ -216,7 +215,7 @@ void SingleRootMultiSubDeviceFixtureWithImplicitScalingImpl::tearDown() { } void GetMemHandlePtrTestFixture::setUp() { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); diff --git a/level_zero/core/test/unit_tests/fixtures/device_fixture.h b/level_zero/core/test/unit_tests/fixtures/device_fixture.h index ed85b23b9f..bc32af4cf3 100644 --- a/level_zero/core/test/unit_tests/fixtures/device_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/device_fixture.h @@ -31,7 +31,7 @@ namespace ult { class MockBuiltins; struct DeviceFixture { - NEO::MockCompilerEnableGuard compilerMock = NEO::MockCompilerEnableGuard(true); + void setUp(); void tearDown(); void setupWithExecutionEnvironment(NEO::ExecutionEnvironment &executionEnvironment); @@ -65,7 +65,7 @@ struct DriverHandleGetMemHandlePtrMock : public L0::DriverHandleImp { }; struct GetMemHandlePtrTestFixture { - NEO::MockCompilerEnableGuard compilerMock = NEO::MockCompilerEnableGuard(true); + void setUp(); void tearDown(); NEO::MemoryManager *prevMemoryManager = nullptr; @@ -79,7 +79,7 @@ struct GetMemHandlePtrTestFixture { struct PageFaultDeviceFixture { PageFaultDeviceFixture(); ~PageFaultDeviceFixture(); - NEO::MockCompilerEnableGuard compilerMock = NEO::MockCompilerEnableGuard(true); + void setUp(); void tearDown(); @@ -93,7 +93,7 @@ struct PageFaultDeviceFixture { }; struct MultiDeviceFixture { - NEO::MockCompilerEnableGuard compilerMock = NEO::MockCompilerEnableGuard(true); + void setUp(); void tearDown(); @@ -140,7 +140,6 @@ struct MultipleDevicesWithCustomHwInfo { struct SingleRootMultiSubDeviceFixtureWithImplicitScalingImpl : public MultiDeviceFixture { SingleRootMultiSubDeviceFixtureWithImplicitScalingImpl(uint32_t copyEngineCount, uint32_t implicitScaling) : implicitScaling(implicitScaling), expectedCopyEngineCount(copyEngineCount){}; - NEO::MockCompilerEnableGuard compilerMock = NEO::MockCompilerEnableGuard(true); DebugManagerStateRestore restorer; std::unique_ptr> driverHandle; diff --git a/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h b/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h index 2600b03189..a0aea6e6ff 100644 --- a/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/host_pointer_manager_fixture.h @@ -26,7 +26,7 @@ namespace ult { struct HostPointerManagerFixure { void setUp() { - NEO::MockCompilerEnableGuard mock(true); + NEO::DeviceVector devices; neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); diff --git a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h index 5b36eb9339..89ff6dcc1b 100644 --- a/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/memory_ipc_fixture.h @@ -106,7 +106,7 @@ struct ContextFdMock : public L0::ContextImp { struct MemoryExportImportTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); @@ -215,7 +215,7 @@ struct ContextMemHandleMock : public L0::ContextImp { struct MemoryExportImportWSLTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); @@ -314,7 +314,7 @@ struct ContextHandleMock : public L0::ContextImp { struct MemoryExportImportWinHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); @@ -557,7 +557,7 @@ struct ContextIpcMock : public L0::ContextImp { struct MemoryOpenIpcHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -689,7 +689,6 @@ struct MemoryExportImportImplicitScalingTest : public ::testing::Test { DebugManagerStateRestore restorer; DebugManager.flags.EnableImplicitScaling.set(1); - NEO::MockCompilerEnableGuard mock(true); neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); diff --git a/level_zero/core/test/unit_tests/fixtures/module_fixture.h b/level_zero/core/test/unit_tests/fixtures/module_fixture.h index 1eaf1041df..26c93aae71 100644 --- a/level_zero/core/test/unit_tests/fixtures/module_fixture.h +++ b/level_zero/core/test/unit_tests/fixtures/module_fixture.h @@ -199,7 +199,7 @@ struct ModuleImmutableDataFixture : public DeviceFixture { struct ModuleFixture : public DeviceFixture { void setUp() { - NEO::MockCompilerEnableGuard mock(true); + DeviceFixture::setUp(); createModuleFromMockBinary(); } @@ -371,7 +371,7 @@ struct ModuleWithZebinFixture : public DeviceFixture { const char strings[12] = "Hello olleH"; }; void setUp() { - NEO::MockCompilerEnableGuard mock(true); + DeviceFixture::setUp(); module = std::make_unique(device); } diff --git a/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp b/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp index ce32ad499d..321bad7103 100644 --- a/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp +++ b/level_zero/core/test/unit_tests/gen11/test_cmdqueue_thread_arbitration_policy_gen11.cpp @@ -22,7 +22,7 @@ namespace ult { struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue = ZE_RESULT_SUCCESS; auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); diff --git a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp index e9c641bafa..416af92ec3 100644 --- a/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp +++ b/level_zero/core/test/unit_tests/gen9/test_cmdqueue_gen9.cpp @@ -24,7 +24,7 @@ namespace ult { struct CommandQueueThreadArbitrationPolicyTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue = ZE_RESULT_SUCCESS; auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); @@ -169,7 +169,7 @@ HWTEST2_F(CommandQueueThreadArbitrationPolicyTests, struct CommandQueueGroupMultiDeviceFixture : public MultiDeviceFixture { void setUp() { - NEO::MockCompilerEnableGuard mock(true); + MultiDeviceFixture::setUp(); uint32_t count = 1; ze_device_handle_t hDevice; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp index 792160ae69..b3cf5c11da 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_2.cpp @@ -25,7 +25,7 @@ namespace L0 { namespace ult { struct CommandListAppendLaunchKernelSWTags : public Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + NEO::DebugManager.flags.EnableSWTags.set(true); ModuleFixture::setUp(); } @@ -35,7 +35,7 @@ struct CommandListAppendLaunchKernelSWTags : public Test { struct CommandListDualStorage : public Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.EnableLocalMemory.set(1); DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.set(1); ModuleFixture::setUp(); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp index 4de8015b7a..ae96a4e77b 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_2.cpp @@ -700,7 +700,7 @@ TEST_F(CommandQueueInitTests, whenDestroyCommandQueueThenStoreCommandBuffersAsRe struct DeviceWithDualStorage : Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.EnableLocalMemory.set(1); DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.set(1); DeviceFixture::setUp(); diff --git a/level_zero/core/test/unit_tests/sources/context/test_context.cpp b/level_zero/core/test/unit_tests/sources/context/test_context.cpp index bc531b0623..a19819bbbb 100644 --- a/level_zero/core/test/unit_tests/sources/context/test_context.cpp +++ b/level_zero/core/test/unit_tests/sources/context/test_context.cpp @@ -164,7 +164,7 @@ struct SVMAllocsManagerContextMock : public NEO::SVMAllocsManager { struct ContextHostAllocTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); auto executionEnvironment = new NEO::ExecutionEnvironment; auto devices = NEO::DeviceFactory::createDevices(*executionEnvironment); diff --git a/level_zero/core/test/unit_tests/sources/debugger/active_debugger_fixture.h b/level_zero/core/test/unit_tests/sources/debugger/active_debugger_fixture.h index c18aa21704..8bd26d1c82 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/active_debugger_fixture.h +++ b/level_zero/core/test/unit_tests/sources/debugger/active_debugger_fixture.h @@ -28,7 +28,7 @@ namespace ult { struct ActiveDebuggerFixture { void setUp() { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); diff --git a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h index 790ea8cdc4..7b69afb7ba 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h +++ b/level_zero/core/test/unit_tests/sources/debugger/l0_debugger_fixture.h @@ -22,7 +22,7 @@ namespace ult { struct L0DebuggerFixture { void setUp() { - NEO::MockCompilerEnableGuard mock(true); + auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new NEO::MockBuiltins(); executionEnvironment->prepareRootDeviceEnvironments(1); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index 84a858bf48..51e2ffa3ff 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -28,7 +28,7 @@ namespace L0 { namespace ult { using DeviceWithDebuggerEnabledTest = Test; TEST_F(DeviceWithDebuggerEnabledTest, givenDebuggingEnabledWhenModuleIsCreatedThenDebugOptionsAreUsed) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = true; @@ -54,7 +54,6 @@ TEST_F(DeviceWithDebuggerEnabledTest, GivenDebugVarDebuggerOptDisableZeroWhenOpt DebugManagerStateRestore dgbRestorer; NEO::DebugManager.flags.DebuggerOptDisable.set(0); - NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = true; @@ -78,7 +77,6 @@ TEST_F(DeviceWithDebuggerEnabledTest, GivenDebugVarDebuggerOptDisableOneWhenOptD DebugManagerStateRestore dgbRestorer; NEO::DebugManager.flags.DebuggerOptDisable.set(1); - NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); debugger->isOptDisabled = false; @@ -99,7 +97,7 @@ TEST_F(DeviceWithDebuggerEnabledTest, GivenDebugVarDebuggerOptDisableOneWhenOptD }; TEST_F(DeviceWithDebuggerEnabledTest, GivenDebuggeableKernelWhenModuleIsInitializedThenDebugEnabledIsTrue) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -132,7 +130,7 @@ TEST_F(DeviceWithDebuggerEnabledTest, GivenDebuggeableKernelWhenModuleIsInitiali } TEST_F(DeviceWithDebuggerEnabledTest, GivenNonDebuggeableKernelWhenModuleIsInitializedThenDebugEnabledIsFalse) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -164,7 +162,7 @@ TEST_F(DeviceWithDebuggerEnabledTest, GivenNonDebuggeableKernelWhenModuleIsIniti using ModuleWithSLDTest = Test; TEST_F(ModuleWithSLDTest, GivenNoDebugDataWhenInitializingModuleThenRelocatedDebugDataIsNotCreated) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); @@ -206,7 +204,7 @@ TEST_F(ModuleWithSLDTest, GivenNoDebugDataWhenInitializingModuleThenRelocatedDeb } TEST_F(ModuleWithSLDTest, GivenDebugDataWithSingleRelocationWhenInitializingModuleThenRelocatedDebugDataIsNotCreated) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); @@ -254,7 +252,7 @@ TEST_F(ModuleWithSLDTest, GivenDebugDataWithSingleRelocationWhenInitializingModu } TEST_F(ModuleWithSLDTest, GivenDebugDataWithMultipleRelocationsWhenInitializingModuleThenRelocatedDebugDataIsCreated) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); auto debugger = new MockActiveSourceLevelDebugger(new MockOsLibrary); @@ -314,7 +312,7 @@ TEST_F(ModuleWithZebinAndSLDTest, GivenZebinThenCreateDebugZebinAndPassToSLD) { using KernelDebugSurfaceTest = Test; HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKernelToCommandListThenBindfulSurfaceStateForDebugSurfaceIsProgrammed) { - NEO::MockCompilerEnableGuard mock(true); + using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; auto debugger = MockDebuggerL0Hw::allocate(neoDevice); @@ -379,7 +377,7 @@ HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKerne using ModuleWithDebuggerL0Test = Test; TEST_F(ModuleWithDebuggerL0Test, givenDebuggingEnabledWhenModuleIsCreatedThenDebugOptionsAreNotUsed) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -423,7 +421,7 @@ TEST_F(KernelInitializeTest, givenDebuggingEnabledWhenKernelsAreInitializedThenA using ModuleWithDebuggerL0MultiTileTest = Test; HWTEST_F(ModuleWithDebuggerL0MultiTileTest, GivenSubDeviceWhenCreatingModuleThenModuleCreateIsNotifiedWithCorrectDevice) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); neoDevice->getExecutionEnvironment()->setDebuggingEnabled(); @@ -474,7 +472,7 @@ HWTEST_F(ModuleWithDebuggerL0MultiTileTest, GivenSubDeviceWhenCreatingModuleThen } HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithRelocationsWhenInitializingModuleThenRegisterElfWithRelocatedElfAndModuleCreateNotified) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -519,7 +517,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithRelocationsWhenInitializing } HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithoutRelocationsWhenInitializingModuleThenRegisterElfWithUnrelocatedElfAndModuleCreateNotified) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -570,7 +568,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithoutRelocationsWhenInitializ } HWTEST_F(ModuleWithDebuggerL0Test, GivenNoDebugDataWhenInitializingModuleThenDoNotRegisterElfAndNotifyModuleCreate) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -606,7 +604,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenNoDebugDataWhenInitializingModuleThenDoN using ModuleWithZebinAndL0DebuggerTest = Test; HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinDebugDataWhenInitializingModuleThenRegisterElfAndNotifyModuleCreate) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; @@ -644,7 +642,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinDebugDataWhenInitializingMo } HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinNoDebugDataWhenInitializingModuleThenDoNotRegisterElfAndDoNotNotifyModuleCreate) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -664,7 +662,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinNoDebugDataWhenInitializing } HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinWhenModuleIsInitializedAndDestroyedThenModuleHandleIsAttachedAndRemoved) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; @@ -710,7 +708,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinWhenModuleIsInitializedAndD } HWTEST_F(ModuleWithDebuggerL0Test, GivenNonZebinBinaryWhenDestroyModuleThenModuleDestroyNotified) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = std::make_unique(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface = std::move(cip); @@ -758,7 +756,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenNonZebinBinaryWhenDestroyModuleThenModul } HWTEST_F(ModuleWithDebuggerL0Test, GivenNoDebugDataWhenDestroyingModuleThenNotifyModuleDestroy) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = std::make_unique(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface = std::move(cip); @@ -792,7 +790,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenNoDebugDataWhenDestroyingModuleThenNotif } HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenModuleDebugHandleZeroWhenInitializingAndDestoryingModuleThenHandleIsNotPassedToDebugger) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); uint8_t binary[10]; @@ -837,7 +835,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenModuleDebugHandleZeroWhenInitial using NotifyModuleLoadTest = Test; HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleIsCreatedAndFullyLinkedThenIsaAllocationsAreCopiedAndResidentOnlyForUserModules) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -895,7 +893,7 @@ HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleIsCreatedAndFullyL } HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleWithUnresolvedSymbolsIsCreatedThenIsaAllocationsAreNotCopiedAndNotResident) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -943,7 +941,7 @@ HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleWithUnresolvedSymb } HWTEST_F(NotifyModuleLoadTest, givenDebuggingEnabledWhenModuleWithUnresolvedSymbolsIsDynamicallyLinkedThenIsaAllocationsAreCopiedAndMadeResident) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp index 72c468fc2e..4f28c53146 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_source_level_debugger.cpp @@ -28,7 +28,7 @@ namespace ult { using CommandQueueDebugCommandsTest = Test; HWTEST2_F(CommandQueueDebugCommandsTest, givenDebuggingEnabledWhenCommandListIsExecutedThenKernelDebugCommandsAreAdded, IsAtMostGen12lp) { - NEO::MockCompilerEnableGuard mock(true); + ze_command_queue_desc_t queueDesc = {}; ze_result_t returnValue; auto commandQueue = whiteboxCast(CommandQueue::create(productFamily, deviceL0, device->getDefaultEngine().commandStreamReceiver, &queueDesc, false, false, returnValue)); @@ -256,7 +256,7 @@ struct TwoSubDevicesDebuggerEnabledTest : public ActiveDebuggerFixture, public : }; TEST_F(TwoSubDevicesDebuggerEnabledTest, givenDebuggingEnabledWhenSubDevicesAreCreatedThenDebugSurfaceFromRootDeviceIsSet) { - NEO::MockCompilerEnableGuard mock(true); + auto subDevice0 = static_cast(deviceL0)->subDevices[0]; auto subDevice1 = static_cast(deviceL0)->subDevices[1]; @@ -268,7 +268,6 @@ TEST_F(TwoSubDevicesDebuggerEnabledTest, givenDebuggingEnabledWhenSubDevicesAreC } TEST_F(TwoSubDevicesDebuggerEnabledTest, givenDebuggingEnabledWhenSubDevicesAreCreatedThenDebugSurfaceIsProperlyInitialized) { - NEO::MockCompilerEnableGuard mock(true); auto debugSurface = deviceL0->getDebugSurface(); diff --git a/level_zero/core/test/unit_tests/sources/device/test_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_device.cpp index a74c1d2eb2..337add4cd7 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_device.cpp @@ -53,7 +53,7 @@ namespace L0 { namespace ult { TEST(L0DeviceTest, givenNonExistingFclWhenCreatingDeviceThenCompilerInterfaceIsCreated) { - NEO::MockCompilerEnableGuard mock(true); + VariableBackup frontEndDllName(&Os::frontEndDllName); Os::frontEndDllName = "_fake_fcl1_so"; @@ -163,7 +163,7 @@ TEST(L0DeviceTest, givenMultipleMaskedSubDevicesWhenCreatingL0DeviceThenDontAddD } TEST(L0DeviceTest, givenMidThreadPreemptionWhenCreatingDeviceThenSipKernelIsInitialized) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue = ZE_RESULT_SUCCESS; VariableBackup mockSipCalled(&NEO::MockSipData::called, false); VariableBackup mockSipCalledType(&NEO::MockSipData::calledType, NEO::SipKernelType::COUNT); @@ -186,7 +186,7 @@ TEST(L0DeviceTest, givenMidThreadPreemptionWhenCreatingDeviceThenSipKernelIsInit } TEST(L0DeviceTest, givenDebuggerEnabledButIGCNotReturnsSSAHThenSSAHIsNotCopied) { - NEO::MockCompilerEnableGuard mock(true); + auto executionEnvironment = new NEO::ExecutionEnvironment(); auto mockBuiltIns = new MockBuiltins(); mockBuiltIns->stateSaveAreaHeader.clear(); @@ -273,7 +273,7 @@ TEST(L0DeviceTest, givenDeviceWithoutAnyCompilerLibraryThenInvalidDependencyRetu } TEST(L0DeviceTest, givenFilledTopologyWhenGettingApiSliceThenCorrectSliceIdIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -318,7 +318,7 @@ TEST(L0DeviceTest, givenFilledTopologyWhenGettingApiSliceThenCorrectSliceIdIsRet } TEST(L0DeviceTest, givenFilledTopologyForZeroSubDeviceWhenGettingApiSliceForHigherSubDevicesThenFalseIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -350,7 +350,7 @@ TEST(L0DeviceTest, givenFilledTopologyForZeroSubDeviceWhenGettingApiSliceForHigh } TEST(L0DeviceTest, givenInvalidPhysicalSliceIdWhenGettingApiSliceIdThenFalseIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -382,7 +382,7 @@ TEST(L0DeviceTest, givenInvalidPhysicalSliceIdWhenGettingApiSliceIdThenFalseIsRe } TEST(L0DeviceTest, givenInvalidApiSliceIdWhenGettingPhysicalSliceIdThenFalseIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -415,7 +415,7 @@ TEST(L0DeviceTest, givenInvalidApiSliceIdWhenGettingPhysicalSliceIdThenFalseIsRe } TEST(L0DeviceTest, givenEmptyTopologyWhenGettingApiSliceIdThenFalseIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -434,7 +434,7 @@ TEST(L0DeviceTest, givenEmptyTopologyWhenGettingApiSliceIdThenFalseIsReturned) { } TEST(L0DeviceTest, givenDeviceWithoutSubDevicesWhenGettingPhysicalSliceIdThenCorrectValuesAreReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -470,7 +470,7 @@ TEST(L0DeviceTest, givenDeviceWithoutSubDevicesWhenGettingPhysicalSliceIdThenCor } TEST(L0DeviceTest, givenTopologyNotAvaialbleWhenGettingPhysicalSliceIdThenFalseIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -492,7 +492,7 @@ TEST(L0DeviceTest, givenTopologyNotAvaialbleWhenGettingPhysicalSliceIdThenFalseI } TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToApiIdsThenSubsliceIdsAreRemapped) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -544,7 +544,7 @@ TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToApiIdsThenSubsliceIds } TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToPhysicalIdsThenSubsliceIdsAreRemapped) { - NEO::MockCompilerEnableGuard mock(true); + std::unique_ptr driverHandle(new DriverHandleImp); auto hwInfo = *NEO::defaultHwInfo; @@ -600,7 +600,6 @@ TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToPhysicalIdsThenSubsli struct DeviceTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), rootDeviceIndex); execEnv = neoDevice->getExecutionEnvironment(); @@ -1172,7 +1171,7 @@ struct DeviceHwInfoTest : public ::testing::Test { } void setDriverAndDevice() { - NEO::MockCompilerEnableGuard mock(true); + std::vector> devices; neoDevice = NEO::MockDevice::create(executionEnvironment, 0); EXPECT_NE(neoDevice, nullptr); @@ -1781,7 +1780,7 @@ struct MockMemoryManagerMultiDevice : public MemoryManagerMock { template struct MultipleDevicesFixture : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.EnableWalkerPartition.set(enablePartitionWalker); DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices); VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); @@ -2054,7 +2053,7 @@ TEST_F(DeviceTests, WhenGettingMemoryAccessPropertiesThenSuccessIsReturned) { template struct MultipleDevicesP2PFixture : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); std::vector> devices; @@ -3231,7 +3230,7 @@ TEST(zeDevice, givenValidImagePropertiesStructWhenGettingImagePropertiesThenSucc TEST(zeDevice, givenImagesSupportedWhenGettingImagePropertiesThenValidValuesAreReturned) { ze_result_t errorValue; - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp driverHandle{}; NEO::MockDevice *neoDevice = (NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); auto device = std::unique_ptr(Device::create(&driverHandle, neoDevice, false, &errorValue)); @@ -3262,7 +3261,7 @@ TEST(zeDevice, givenImagesSupportedWhenGettingImagePropertiesThenValidValuesAreR TEST(zeDevice, givenNoImagesSupportedWhenGettingImagePropertiesThenZeroValuesAreReturned) { ze_result_t errorValue; - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp driverHandle{}; NEO::MockDevice *neoDevice = (NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); auto device = std::unique_ptr(Device::create(&driverHandle, neoDevice, false, &errorValue)); diff --git a/level_zero/core/test/unit_tests/sources/driver/linux/test_driver_handle_imp_linux.cpp b/level_zero/core/test/unit_tests/sources/driver/linux/test_driver_handle_imp_linux.cpp index dda0f08429..e41fda26e3 100644 --- a/level_zero/core/test/unit_tests/sources/driver/linux/test_driver_handle_imp_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/linux/test_driver_handle_imp_linux.cpp @@ -32,7 +32,7 @@ class TestDriverMockDrm : public Drm { class DriverLinuxFixture : public ::testing::Test { public: void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -82,7 +82,7 @@ class DriverLinuxWithPciOrderTests : public DriverLinuxFixture { }; TEST_F(DriverLinuxWithPciOrderTests, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAccordingToBusOrderRetrieved) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -112,7 +112,7 @@ class DriverLinuxWithouthPciOrderTests : public DriverLinuxFixture { }; TEST_F(DriverLinuxWithouthPciOrderTests, GivenNoEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAreNotSorted) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -134,7 +134,6 @@ class DriverPciOrderWitSimilarBusLinuxFixture : public ::testing::Test { DebugManagerStateRestore restorer; DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.set(1); - NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -171,7 +170,7 @@ class DriverPciOrderWitSimilarBusLinuxFixture : public ::testing::Test { }; TEST_F(DriverPciOrderWitSimilarBusLinuxFixture, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAccordingToBusOrderRetrieved) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -193,7 +192,6 @@ class DriverPciOrderWitDifferentDeviceLinuxFixture : public ::testing::Test { DebugManagerStateRestore restorer; DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.set(1); - NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -230,7 +228,7 @@ class DriverPciOrderWitDifferentDeviceLinuxFixture : public ::testing::Test { }; TEST_F(DriverPciOrderWitDifferentDeviceLinuxFixture, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAccordingToBusOrderRetrieved) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -252,7 +250,6 @@ class DriverPciOrderWitSimilarBusAndDeviceLinuxFixture : public ::testing::Test DebugManagerStateRestore restorer; DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.set(1); - NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -289,7 +286,7 @@ class DriverPciOrderWitSimilarBusAndDeviceLinuxFixture : public ::testing::Test }; TEST_F(DriverPciOrderWitSimilarBusAndDeviceLinuxFixture, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAccordingToBusOrderRetrieved) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -311,7 +308,6 @@ class DriverPciOrderWitSimilarBDFLinuxFixture : public ::testing::Test { DebugManagerStateRestore restorer; DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.set(1); - NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -348,7 +344,7 @@ class DriverPciOrderWitSimilarBDFLinuxFixture : public ::testing::Test { }; TEST_F(DriverPciOrderWitSimilarBDFLinuxFixture, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetWhenRetrievingNeoDevicesThenNeoDevicesAccordingToDomainOrderRetrieved) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -370,7 +366,6 @@ class DriverPciOrderSortDoesNothing : public ::testing::Test { DebugManagerStateRestore restorer; DebugManager.flags.ZE_ENABLE_PCI_ID_DEVICE_ORDER.set(1); - NEO::MockCompilerEnableGuard mock(true); auto executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); @@ -407,7 +402,7 @@ class DriverPciOrderSortDoesNothing : public ::testing::Test { }; TEST_F(DriverPciOrderSortDoesNothing, GivenEnvironmentVariableForDeviceOrderAccordingToPciSetThenVerifyCaseSortDoesNothing) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); @@ -426,7 +421,7 @@ TEST_F(DriverPciOrderSortDoesNothing, GivenEnvironmentVariableForDeviceOrderAcco class DriverWDDMLinuxFixture : public ::testing::Test { public: void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { @@ -451,7 +446,7 @@ class DriverWDDMLinuxFixture : public ::testing::Test { }; TEST_F(DriverWDDMLinuxFixture, ClearPciSortFlagToVerifyCodeCoverageOnly) { - NEO::MockCompilerEnableGuard mock(true); + DriverHandleImp *driverHandle = new DriverHandleImp; EXPECT_EQ(ZE_RESULT_SUCCESS, driverHandle->initialize(std::move(devices))); DebugManagerStateRestore restorer; diff --git a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp index fd4357f416..4ebb930015 100644 --- a/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp +++ b/level_zero/core/test/unit_tests/sources/driver/test_driver.cpp @@ -103,7 +103,7 @@ TEST_F(DriverVersionTest, WhenGettingDriverVersionThenExpectedDriverVersionIsRet } TEST_F(DriverVersionTest, givenCallToGetDriverPropertiesThenUuidIsSet) { - NEO::MockCompilerEnableGuard mock(true); + ze_driver_properties_t properties; ze_result_t res = driverHandle->getProperties(&properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); @@ -123,7 +123,7 @@ TEST_F(DriverVersionTest, givenCallToGetDriverPropertiesThenUuidIsSet) { } TEST_F(DriverVersionTest, whenCallingGetDriverPropertiesRepeatedlyThenTheSameUuidIsReturned) { - NEO::MockCompilerEnableGuard mock(true); + ze_driver_properties_t properties; ze_result_t res = driverHandle->getProperties(&properties); EXPECT_EQ(ZE_RESULT_SUCCESS, res); @@ -245,7 +245,7 @@ HWTEST_F(ImportNTHandle, givenNotExistingNTHandleWhenCreatingDeviceMemoryThenErr } TEST(DriverTestFamilySupport, whenInitializingDriverOnSupportedFamilyThenDriverIsCreated) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -274,7 +274,7 @@ TEST(DriverTestFamilySupport, whenInitializingDriverOnNotSupportedFamilyThenDriv } TEST(DriverTest, givenNullEnvVariableWhenCreatingDriverThenEnableProgramDebuggingIsFalse) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -295,7 +295,7 @@ TEST(DriverTest, givenNullEnvVariableWhenCreatingDriverThenEnableProgramDebuggin } TEST(DriverImpTest, givenDriverImpWhenInitializedThenEnvVariablesAreRead) { - NEO::MockCompilerEnableGuard mock(true); + NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -313,7 +313,7 @@ TEST(DriverImpTest, givenDriverImpWhenInitializedThenEnvVariablesAreRead) { } TEST(DriverImpTest, givenMissingMetricApiDependenciesWhenInitializingDriverImpThenGlobalDriverHandleIsNull) { - NEO::MockCompilerEnableGuard mock(true); + NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); @@ -334,7 +334,7 @@ TEST(DriverImpTest, givenMissingMetricApiDependenciesWhenInitializingDriverImpTh } TEST(DriverImpTest, givenEnabledProgramDebuggingWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsTrue) { - NEO::MockCompilerEnableGuard mock(true); + NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -356,7 +356,7 @@ TEST(DriverImpTest, givenEnabledProgramDebuggingWhenCreatingExecutionEnvironment } TEST(DriverImpTest, givenNoProgramDebuggingEnvVarWhenCreatingExecutionEnvironmentThenDebuggingEnabledIsFalse) { - NEO::MockCompilerEnableGuard mock(true); + NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -374,7 +374,7 @@ TEST(DriverImpTest, givenNoProgramDebuggingEnvVarWhenCreatingExecutionEnvironmen } TEST(DriverTest, givenProgramDebuggingEnvVarNonZeroWhenCreatingDriverThenEnableProgramDebuggingIsSetTrue) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; @@ -416,7 +416,7 @@ TEST(DriverTest, givenInvalidCompilerEnvironmentThenDependencyUnavailableErrorIs struct DriverTestMultipleFamilySupport : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); deviceFactory = std::make_unique(numRootDevices, numSubDevices); @@ -439,7 +439,7 @@ struct DriverTestMultipleFamilySupport : public ::testing::Test { }; TEST_F(DriverTestMultipleFamilySupport, whenInitializingDriverWithArrayOfDevicesThenDriverIsInitializedOnlyWithThoseSupported) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; auto driverHandle = DriverHandle::create(std::move(devices), L0EnvVariables{}, &returnValue); EXPECT_NE(nullptr, driverHandle); @@ -457,7 +457,7 @@ TEST_F(DriverTestMultipleFamilySupport, whenInitializingDriverWithArrayOfDevices struct DriverTestMultipleFamilyNoSupport : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); NEO::ExecutionEnvironment *executionEnvironment = new NEO::ExecutionEnvironment(); @@ -480,7 +480,7 @@ struct DriverTestMultipleFamilyNoSupport : public ::testing::Test { }; TEST_F(DriverTestMultipleFamilyNoSupport, whenInitializingDriverWithArrayOfNotSupportedDevicesThenDriverIsNull) { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; auto driverHandle = DriverHandle::create(std::move(devices), L0EnvVariables{}, &returnValue); EXPECT_EQ(nullptr, driverHandle); @@ -492,7 +492,7 @@ struct MaskArray { struct DriverHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + ze_result_t returnValue; NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get(); hwInfo.capabilityTable.levelZeroSupported = true; diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index 168531f0cb..6f739b936b 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -83,7 +83,7 @@ class MemoryManagerEventPoolFailMock : public NEO::MemoryManager { struct EventPoolFailTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -1760,7 +1760,7 @@ TEST_F(EventPoolCreateSingleDevice, whenCreatingEventPoolWithNoDevicesThenEventP struct EventPoolCreateNegativeTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); for (uint32_t i = 0; i < numRootDevices; i++) { diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp index 177e67c43e..2fbef2f4cb 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp @@ -632,7 +632,7 @@ TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedThenIsaIs } TEST_F(KernelImmutableDataTests, givenInternalModuleWhenKernelIsCreatedIsaIsNotCopiedDuringLinking) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp index 31581f1021..1c3dc1a599 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory.cpp @@ -783,7 +783,7 @@ struct ContextZexPointerMock : public ContextImp { struct ZexHostPointerTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -906,7 +906,7 @@ struct SVMAllocsManagerFreeExtMock : public NEO::SVMAllocsManager { struct FreeExtTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -1028,7 +1028,7 @@ struct SVMAllocsManagerOutOFMemoryMock : public NEO::SVMAllocsManager { struct OutOfMemoryTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -1104,7 +1104,7 @@ struct ContextRelaxedSizeMock : public ContextImp { struct MemoryRelaxedSizeTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -1615,7 +1615,7 @@ struct ContextFailFdMock : public L0::ContextImp { struct MemoryExportImportFailTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); @@ -2099,7 +2099,6 @@ TEST_F(ImageFdExportImportTest, struct MultipleDevicePeerAllocationFailTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); std::vector> devices; NEO::ExecutionEnvironment *executionEnvironment = new NEO::ExecutionEnvironment(); @@ -2182,7 +2181,7 @@ struct MultipleDevicePeerAllocationTest : public ::testing::Test { void SetUp() override { DebugManagerStateRestore restorer; - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices); VariableBackup mockDeviceFlagBackup(&MockDevice::createSingleDevice, false); @@ -2942,7 +2941,7 @@ TEST_F(MultipleDevicePeerAllocationTest, struct MemoryFailedOpenIpcHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -2980,7 +2979,7 @@ struct MemoryFailedOpenIpcHandleImplicitScalingTest : public ::testing::Test { void SetUp() override { DebugManagerStateRestore restorer; DebugManager.flags.EnableImplicitScaling.set(1); - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -3258,7 +3257,7 @@ TEST_F(MemoryTest, givenCallToCheckMemoryAccessFromDeviceWithValidHostAllocation struct MemoryBitfieldTest : testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(1); executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get()); @@ -3301,7 +3300,7 @@ struct MemoryBitfieldTest : testing::Test { }; TEST_F(MemoryBitfieldTest, givenDeviceWithValidBitfieldWhenAllocatingDeviceMemoryThenPassProperBitfield) { - NEO::MockCompilerEnableGuard mock(true); + ze_device_mem_alloc_desc_t deviceDesc = {}; auto result = context->allocDeviceMem(device->toHandle(), &deviceDesc, @@ -3312,7 +3311,7 @@ TEST_F(MemoryBitfieldTest, givenDeviceWithValidBitfieldWhenAllocatingDeviceMemor EXPECT_NE(nullptr, ptr); } TEST(MemoryBitfieldTests, givenDeviceWithValidBitfieldWhenAllocatingSharedMemoryThenPassProperBitfield) { - NEO::MockCompilerEnableGuard mock(true); + DebugManagerStateRestore restorer; size_t size = 10; size_t alignment = 1u; @@ -3377,7 +3376,7 @@ TEST(MemoryBitfieldTests, givenDeviceWithValidBitfieldWhenAllocatingSharedMemory struct AllocHostMemoryTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + std::vector> devices; NEO::ExecutionEnvironment *executionEnvironment = new NEO::ExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(numRootDevices); @@ -3724,7 +3723,7 @@ struct SVMAllocsManagerSharedAllocFailMock : public NEO::SVMAllocsManager { struct SharedAllocFailTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); @@ -3796,7 +3795,7 @@ struct ContextMultiDeviceMock : public L0::ContextImp { struct SharedAllocMultiDeviceTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices); auto executionEnvironment = new NEO::ExecutionEnvironment; auto devices = NEO::DeviceFactory::createDevices(*executionEnvironment); @@ -3872,7 +3871,7 @@ TEST_F(SharedAllocMultiDeviceTests, whenAllocatinSharedMemoryWithNonNullDeviceIn template struct MemAllocMultiSubDeviceTests : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + DebugManager.flags.EnableWalkerPartition.set(enableWalkerPartition); DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices); auto executionEnvironment = new NEO::ExecutionEnvironment; diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm/test_memory_drm.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm/test_memory_drm.cpp index df8577795c..4e4da5a116 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm/test_memory_drm.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm/test_memory_drm.cpp @@ -143,7 +143,7 @@ TEST_F(MemoryIPCTests, struct MemoryGetIpcHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm_or_wddm/test_memory_drm_or_wddm.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm_or_wddm/test_memory_drm_or_wddm.cpp index 60dbf4e879..d3379a80ba 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory_drm_or_wddm/test_memory_drm_or_wddm.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory_drm_or_wddm/test_memory_drm_or_wddm.cpp @@ -143,7 +143,7 @@ TEST_F(MemoryIPCTests, struct MemoryGetIpcHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); diff --git a/level_zero/core/test/unit_tests/sources/memory/test_memory_wddm/test_memory_wddm.cpp b/level_zero/core/test/unit_tests/sources/memory/test_memory_wddm/test_memory_wddm.cpp index a12f948007..e7a70afca0 100644 --- a/level_zero/core/test/unit_tests/sources/memory/test_memory_wddm/test_memory_wddm.cpp +++ b/level_zero/core/test/unit_tests/sources/memory/test_memory_wddm/test_memory_wddm.cpp @@ -135,7 +135,7 @@ TEST_F(MemoryIPCTests, struct MemoryGetIpcHandleTest : public ::testing::Test { void SetUp() override { - NEO::MockCompilerEnableGuard mock(true); + neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get()); auto mockBuiltIns = new MockBuiltins(); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index 7440b0e730..11f2148516 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -106,7 +106,7 @@ HWTEST_F(ModuleTest, givenBuiltinModuleWhenCreatedThenCorrectAllocationTypeIsUse } HWTEST_F(ModuleTest, givenBlitterAvailableWhenCopyingPatchedSegmentsThenIsaIsTransferredToAllocationWithBlitter) { - NEO::MockCompilerEnableGuard mock(true); + auto hwInfo = *NEO::defaultHwInfo; hwInfo.featureTable.flags.ftrLocalMemory = true; auto executionEnvironment = MockDevice::prepareExecutionEnvironment(&hwInfo, 0u); @@ -1653,7 +1653,7 @@ TEST_F(ModuleDynamicLinkTests, givenModuleWithUnresolvedSymbolsNotPresentInAnoth using ModuleDynamicLinkTest = Test; TEST_F(ModuleDynamicLinkTest, givenUnresolvedSymbolsWhenModuleIsCreatedThenIsaAllocationsAreNotCopied) { - NEO::MockCompilerEnableGuard mock(true); + auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -2514,7 +2514,6 @@ TEST_F(ModuleTest, GivenInjectInternalBuildOptionsWhenBuildingUserModuleThenInte DebugManagerStateRestore dbgRestorer; DebugManager.flags.InjectInternalBuildOptions.set(" -abc"); - NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); @@ -2537,7 +2536,6 @@ TEST_F(ModuleTest, GivenInjectInternalBuildOptionsWhenBuildingBuiltinModuleThenI DebugManagerStateRestore dbgRestorer; DebugManager.flags.InjectInternalBuildOptions.set(" -abc"); - NEO::MockCompilerEnableGuard mock(true); auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions(); device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip); diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp index 76edd7c06d..1a4d73e587 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/dg2/test_module_dg2.cpp @@ -21,7 +21,6 @@ namespace ult { using KernelDebugSurfaceDG2Test = Test; HWTEST2_F(KernelDebugSurfaceDG2Test, givenDebuggerWhenKernelInitializeCalledThenCachePolicyIsWBP, IsDG2) { - NEO::MockCompilerEnableGuard mock(true); using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; auto debugger = MockDebuggerL0Hw::allocate(neoDevice); @@ -77,7 +76,6 @@ HWTEST2_F(KernelDebugSurfaceDG2Test, givenDebuggerWhenKernelInitializeCalledThen } HWTEST2_F(KernelDebugSurfaceDG2Test, givenNoDebuggerButDebuggerActiveSetWhenPatchWithImplicitSurfaceCalledThenCachePolicyIsWBP, IsDG2) { - NEO::MockCompilerEnableGuard mock(true); using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; const_cast(neoDevice->getDeviceInfo()).debuggerActive = true; diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index aa99514f9c..9b65c26bdc 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -617,7 +617,6 @@ TEST(TranslateTest, whenAnyArgIsNullThenNullptrIsReturnedAndTranslatorIsNotInvok } TEST(LoadCompilerTest, whenEverythingIsOkThenReturnsTrueAndValidOutputs) { - MockCompilerEnableGuard mock; std::unique_ptr retLib; CIF::RAII::UPtr_t retMain; bool retVal = loadCompiler("", retLib, retMain); @@ -627,7 +626,6 @@ TEST(LoadCompilerTest, whenEverythingIsOkThenReturnsTrueAndValidOutputs) { } TEST(LoadCompilerTest, whenCouldNotLoadLibraryThenReturnFalseAndNullOutputs) { - MockCompilerEnableGuard mock; std::unique_ptr retLib; CIF::RAII::UPtr_t retMain; bool retVal = loadCompiler("_falseName.notRealLib", retLib, retMain); @@ -639,7 +637,6 @@ TEST(LoadCompilerTest, whenCouldNotLoadLibraryThenReturnFalseAndNullOutputs) { TEST(LoadCompilerTest, whenCreateMainFailsThenReturnFalseAndNullOutputs) { NEO::failCreateCifMain = true; - MockCompilerEnableGuard mock; std::unique_ptr retLib; CIF::RAII::UPtr_t retMain; bool retVal = loadCompiler("", retLib, retMain); @@ -651,7 +648,7 @@ TEST(LoadCompilerTest, whenCreateMainFailsThenReturnFalseAndNullOutputs) { } TEST(LoadCompilerTest, whenEntrypointInterfaceIsNotCompatibleThenReturnFalseAndNullOutputs) { - MockCompilerEnableGuard mock; + std::unique_ptr retLib; CIF::RAII::UPtr_t retMain; bool retVal = loadCompiler("", retLib, retMain); @@ -664,7 +661,6 @@ TEST(LoadCompilerTest, GivenZebinIgnoreIcbeVersionDebugFlagThenIgnoreIgcsIcbeVer DebugManagerStateRestore dbgRestore; DebugManager.flags.ZebinIgnoreIcbeVersion.set(true); - MockCompilerEnableGuard mock; std::unique_ptr retLib; CIF::RAII::UPtr_t retMain; bool retVal = loadCompiler("", retLib, retMain);