Remove redundant MockCompilerEnableGuard instances

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2022-09-09 17:51:03 +00:00
committed by Compute-Runtime-Automation
parent c7cd14cce7
commit 670926c9b6
26 changed files with 110 additions and 131 deletions

View File

@@ -96,7 +96,7 @@ void MultiDeviceFixture::tearDown() {
}
void MultipleDevicesWithCustomHwInfo::setUp() {
NEO::MockCompilerEnableGuard mock(true);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
std::vector<std::unique_ptr<NEO::Device>> 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::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();

View File

@@ -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<Mock<L0::DriverHandleImp>> driverHandle;

View File

@@ -26,7 +26,7 @@ namespace ult {
struct HostPointerManagerFixure {
void setUp() {
NEO::MockCompilerEnableGuard mock(true);
NEO::DeviceVector devices;
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();

View File

@@ -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::MockDevice>(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::MockDevice>(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::MockDevice>(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::MockDevice>(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::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();

View File

@@ -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<MockModuleWithZebin>(device);
}

View File

@@ -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();

View File

@@ -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;

View File

@@ -25,7 +25,7 @@ namespace L0 {
namespace ult {
struct CommandListAppendLaunchKernelSWTags : public Test<ModuleFixture> {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
NEO::DebugManager.flags.EnableSWTags.set(true);
ModuleFixture::setUp();
}
@@ -35,7 +35,7 @@ struct CommandListAppendLaunchKernelSWTags : public Test<ModuleFixture> {
struct CommandListDualStorage : public Test<ModuleFixture> {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
DebugManager.flags.EnableLocalMemory.set(1);
DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.set(1);
ModuleFixture::setUp();

View File

@@ -700,7 +700,7 @@ TEST_F(CommandQueueInitTests, whenDestroyCommandQueueThenStoreCommandBuffersAsRe
struct DeviceWithDualStorage : Test<DeviceFixture> {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
DebugManager.flags.EnableLocalMemory.set(1);
DebugManager.flags.AllocateSharedAllocationsWithCpuAndGpuStorage.set(1);
DeviceFixture::setUp();

View File

@@ -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);

View File

@@ -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();

View File

@@ -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);

View File

@@ -28,7 +28,7 @@ namespace L0 {
namespace ult {
using DeviceWithDebuggerEnabledTest = Test<ActiveDebuggerFixture>;
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<ModuleFixture>;
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<ModuleFixture>;
HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKernelToCommandListThenBindfulSurfaceStateForDebugSurfaceIsProgrammed) {
NEO::MockCompilerEnableGuard mock(true);
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
auto debugger = MockDebuggerL0Hw<FamilyType>::allocate(neoDevice);
@@ -379,7 +377,7 @@ HWTEST_F(KernelDebugSurfaceTest, givenDebuggerAndBindfulKernelWhenAppendingKerne
using ModuleWithDebuggerL0Test = Test<L0DebuggerHwFixture>;
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<SingleRootMultiSubDeviceFixture>;
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<L0DebuggerHwFixture>;
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<NEO::MockCompilerInterfaceCaptureBuildOptions>();
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<NEO::MockCompilerInterfaceCaptureBuildOptions>();
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<ModuleFixture>;
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);

View File

@@ -28,7 +28,7 @@ namespace ult {
using CommandQueueDebugCommandsTest = Test<ActiveDebuggerFixture>;
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<L0::DeviceImp *>(deviceL0)->subDevices[0];
auto subDevice1 = static_cast<L0::DeviceImp *>(deviceL0)->subDevices[1];
@@ -268,7 +268,6 @@ TEST_F(TwoSubDevicesDebuggerEnabledTest, givenDebuggingEnabledWhenSubDevicesAreC
}
TEST_F(TwoSubDevicesDebuggerEnabledTest, givenDebuggingEnabledWhenSubDevicesAreCreatedThenDebugSurfaceIsProperlyInitialized) {
NEO::MockCompilerEnableGuard mock(true);
auto debugSurface = deviceL0->getDebugSurface();

View File

@@ -53,7 +53,7 @@ namespace L0 {
namespace ult {
TEST(L0DeviceTest, givenNonExistingFclWhenCreatingDeviceThenCompilerInterfaceIsCreated) {
NEO::MockCompilerEnableGuard mock(true);
VariableBackup<const char *> 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<bool> mockSipCalled(&NEO::MockSipData::called, false);
VariableBackup<NEO::SipKernelType> 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<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -318,7 +318,7 @@ TEST(L0DeviceTest, givenFilledTopologyWhenGettingApiSliceThenCorrectSliceIdIsRet
}
TEST(L0DeviceTest, givenFilledTopologyForZeroSubDeviceWhenGettingApiSliceForHigherSubDevicesThenFalseIsReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -350,7 +350,7 @@ TEST(L0DeviceTest, givenFilledTopologyForZeroSubDeviceWhenGettingApiSliceForHigh
}
TEST(L0DeviceTest, givenInvalidPhysicalSliceIdWhenGettingApiSliceIdThenFalseIsReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -382,7 +382,7 @@ TEST(L0DeviceTest, givenInvalidPhysicalSliceIdWhenGettingApiSliceIdThenFalseIsRe
}
TEST(L0DeviceTest, givenInvalidApiSliceIdWhenGettingPhysicalSliceIdThenFalseIsReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -415,7 +415,7 @@ TEST(L0DeviceTest, givenInvalidApiSliceIdWhenGettingPhysicalSliceIdThenFalseIsRe
}
TEST(L0DeviceTest, givenEmptyTopologyWhenGettingApiSliceIdThenFalseIsReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -434,7 +434,7 @@ TEST(L0DeviceTest, givenEmptyTopologyWhenGettingApiSliceIdThenFalseIsReturned) {
}
TEST(L0DeviceTest, givenDeviceWithoutSubDevicesWhenGettingPhysicalSliceIdThenCorrectValuesAreReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -470,7 +470,7 @@ TEST(L0DeviceTest, givenDeviceWithoutSubDevicesWhenGettingPhysicalSliceIdThenCor
}
TEST(L0DeviceTest, givenTopologyNotAvaialbleWhenGettingPhysicalSliceIdThenFalseIsReturned) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -492,7 +492,7 @@ TEST(L0DeviceTest, givenTopologyNotAvaialbleWhenGettingPhysicalSliceIdThenFalseI
}
TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToApiIdsThenSubsliceIdsAreRemapped) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
@@ -544,7 +544,7 @@ TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToApiIdsThenSubsliceIds
}
TEST(L0DeviceTest, givenSingleSliceTopologyWhenConvertingToPhysicalIdsThenSubsliceIdsAreRemapped) {
NEO::MockCompilerEnableGuard mock(true);
std::unique_ptr<DriverHandleImp> 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::MockDevice>(NEO::defaultHwInfo.get(), rootDeviceIndex);
execEnv = neoDevice->getExecutionEnvironment();
@@ -1172,7 +1171,7 @@ struct DeviceHwInfoTest : public ::testing::Test {
}
void setDriverAndDevice() {
NEO::MockCompilerEnableGuard mock(true);
std::vector<std::unique_ptr<NEO::Device>> devices;
neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0);
EXPECT_NE(neoDevice, nullptr);
@@ -1781,7 +1780,7 @@ struct MockMemoryManagerMultiDevice : public MemoryManagerMock {
template <int32_t enablePartitionWalker>
struct MultipleDevicesFixture : public ::testing::Test {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
DebugManager.flags.EnableWalkerPartition.set(enablePartitionWalker);
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
@@ -2054,7 +2053,7 @@ TEST_F(DeviceTests, WhenGettingMemoryAccessPropertiesThenSuccessIsReturned) {
template <bool p2pAccessDevice0, bool p2pAtomicAccessDevice0, bool p2pAccessDevice1, bool p2pAtomicAccessDevice1>
struct MultipleDevicesP2PFixture : public ::testing::Test {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
VariableBackup<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
std::vector<std::unique_ptr<NEO::Device>> 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::MockDevice>(NEO::defaultHwInfo.get(), 0));
auto device = std::unique_ptr<L0::Device>(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::MockDevice>(NEO::defaultHwInfo.get(), 0));
auto device = std::unique_ptr<L0::Device>(Device::create(&driverHandle, neoDevice, false, &errorValue));

View File

@@ -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;

View File

@@ -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<bool> mockDeviceFlagBackup(&MockDevice::createSingleDevice, false);
deviceFactory = std::make_unique<UltDeviceFactory>(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<bool> 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;

View File

@@ -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::MockDevice>(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++) {

View File

@@ -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);

View File

@@ -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::MockDevice>(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::MockDevice>(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::MockDevice>(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::MockDevice>(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::MockDevice>(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<std::unique_ptr<NEO::Device>> 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<bool> 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::MockDevice>(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::MockDevice>(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<std::unique_ptr<NEO::Device>> 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::MockDevice>(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 <int32_t enableWalkerPartition>
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;

View File

@@ -143,7 +143,7 @@ TEST_F(MemoryIPCTests,
struct MemoryGetIpcHandleTest : public ::testing::Test {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);

View File

@@ -143,7 +143,7 @@ TEST_F(MemoryIPCTests,
struct MemoryGetIpcHandleTest : public ::testing::Test {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);

View File

@@ -135,7 +135,7 @@ TEST_F(MemoryIPCTests,
struct MemoryGetIpcHandleTest : public ::testing::Test {
void SetUp() override {
NEO::MockCompilerEnableGuard mock(true);
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get());
auto mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);

View File

@@ -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<ModuleFixture>;
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);

View File

@@ -21,7 +21,6 @@ namespace ult {
using KernelDebugSurfaceDG2Test = Test<ModuleFixture>;
HWTEST2_F(KernelDebugSurfaceDG2Test, givenDebuggerWhenKernelInitializeCalledThenCachePolicyIsWBP, IsDG2) {
NEO::MockCompilerEnableGuard mock(true);
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
auto debugger = MockDebuggerL0Hw<FamilyType>::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<DeviceInfo &>(neoDevice->getDeviceInfo()).debuggerActive = true;

View File

@@ -617,7 +617,6 @@ TEST(TranslateTest, whenAnyArgIsNullThenNullptrIsReturnedAndTranslatorIsNotInvok
}
TEST(LoadCompilerTest, whenEverythingIsOkThenReturnsTrueAndValidOutputs) {
MockCompilerEnableGuard mock;
std::unique_ptr<NEO::OsLibrary> retLib;
CIF::RAII::UPtr_t<CIF::CIFMain> retMain;
bool retVal = loadCompiler<IGC::IgcOclDeviceCtx>("", retLib, retMain);
@@ -627,7 +626,6 @@ TEST(LoadCompilerTest, whenEverythingIsOkThenReturnsTrueAndValidOutputs) {
}
TEST(LoadCompilerTest, whenCouldNotLoadLibraryThenReturnFalseAndNullOutputs) {
MockCompilerEnableGuard mock;
std::unique_ptr<NEO::OsLibrary> retLib;
CIF::RAII::UPtr_t<CIF::CIFMain> retMain;
bool retVal = loadCompiler<IGC::IgcOclDeviceCtx>("_falseName.notRealLib", retLib, retMain);
@@ -639,7 +637,6 @@ TEST(LoadCompilerTest, whenCouldNotLoadLibraryThenReturnFalseAndNullOutputs) {
TEST(LoadCompilerTest, whenCreateMainFailsThenReturnFalseAndNullOutputs) {
NEO::failCreateCifMain = true;
MockCompilerEnableGuard mock;
std::unique_ptr<NEO::OsLibrary> retLib;
CIF::RAII::UPtr_t<CIF::CIFMain> retMain;
bool retVal = loadCompiler<IGC::IgcOclDeviceCtx>("", retLib, retMain);
@@ -651,7 +648,7 @@ TEST(LoadCompilerTest, whenCreateMainFailsThenReturnFalseAndNullOutputs) {
}
TEST(LoadCompilerTest, whenEntrypointInterfaceIsNotCompatibleThenReturnFalseAndNullOutputs) {
MockCompilerEnableGuard mock;
std::unique_ptr<NEO::OsLibrary> retLib;
CIF::RAII::UPtr_t<CIF::CIFMain> retMain;
bool retVal = loadCompiler<IGC::GTSystemInfo>("", retLib, retMain);
@@ -664,7 +661,6 @@ TEST(LoadCompilerTest, GivenZebinIgnoreIcbeVersionDebugFlagThenIgnoreIgcsIcbeVer
DebugManagerStateRestore dbgRestore;
DebugManager.flags.ZebinIgnoreIcbeVersion.set(true);
MockCompilerEnableGuard mock;
std::unique_ptr<NEO::OsLibrary> retLib;
CIF::RAII::UPtr_t<CIF::CIFMain> retMain;
bool retVal = loadCompiler<IGC::IgcOclDeviceCtx>("", retLib, retMain);