diff --git a/level_zero/core/source/device/device.h b/level_zero/core/source/device/device.h index 7e52e04303..25291cda89 100644 --- a/level_zero/core/source/device/device.h +++ b/level_zero/core/source/device/device.h @@ -95,7 +95,6 @@ struct Device : _ze_device_handle_t { virtual ~Device() = default; - virtual void *getExecEnvironment() = 0; virtual BuiltinFunctionsLib *getBuiltinFunctionsLib() = 0; virtual uint32_t getMOCS(bool l3enabled, bool l1enabled) = 0; virtual uint32_t getMaxNumHwThreads() const = 0; diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 1baa974cf9..900cfcfe3f 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -1462,8 +1462,6 @@ ze_result_t DeviceImp::activateMetricGroupsDeferred(uint32_t count, return status; } -void *DeviceImp::getExecEnvironment() { return execEnvironment; } - BuiltinFunctionsLib *DeviceImp::getBuiltinFunctionsLib() { return builtins.get(); } uint32_t DeviceImp::getMOCS(bool l3enabled, bool l1enabled) { @@ -1542,7 +1540,6 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool auto &rootDeviceEnvironment = neoDevice->getRootDeviceEnvironment(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); - device->execEnvironment = (void *)neoDevice->getExecutionEnvironment(); device->allocationsForReuse = std::make_unique(); bool platformImplicitScaling = gfxCoreHelper.platformSupportsImplicitScaling(rootDeviceEnvironment); device->implicitScalingCapable = NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), platformImplicitScaling); diff --git a/level_zero/core/source/device/device_imp.h b/level_zero/core/source/device/device_imp.h index 91a5e631bb..3a82f57006 100644 --- a/level_zero/core/source/device/device_imp.h +++ b/level_zero/core/source/device/device_imp.h @@ -76,7 +76,6 @@ struct DeviceImp : public Device, NEO::NonCopyableAndNonMovableClass { ze_result_t systemBarrier() override; ze_result_t synchronize() override; - void *getExecEnvironment() override; BuiltinFunctionsLib *getBuiltinFunctionsLib() override; uint32_t getMOCS(bool l3enabled, bool l1enabled) override; const NEO::GfxCoreHelper &getGfxCoreHelper() override; @@ -129,7 +128,6 @@ struct DeviceImp : public Device, NEO::NonCopyableAndNonMovableClass { uint32_t getPhysicalSubDeviceId(); bool isSubdevice = false; - void *execEnvironment = nullptr; std::unique_ptr builtins; std::unique_ptr metricContext; std::unique_ptr cacheReservation; diff --git a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp index 49d88942af..ccd1d22295 100644 --- a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp +++ b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp @@ -57,7 +57,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0, false); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -74,7 +74,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -106,7 +106,7 @@ HWTEST2_F(DeviceCopyQueueGroupGen12LpTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -131,7 +131,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -175,7 +175,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -220,7 +220,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -257,7 +257,7 @@ HWTEST2_F(CommandQueueGroupTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); diff --git a/level_zero/core/test/unit_tests/mocks/mock_device.h b/level_zero/core/test/unit_tests/mocks/mock_device.h index 2806da6028..f833163a5d 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device.h @@ -53,7 +53,6 @@ struct MockDevice : public Device { ADDMETHOD_NOBASE(synchronize, ze_result_t, ZE_RESULT_SUCCESS, ()); ADDMETHOD_NOBASE(getRootDevice, ze_result_t, ZE_RESULT_SUCCESS, (ze_device_handle_t * phRootDevice)); // Runtime internal methods - ADDMETHOD_NOBASE(getExecEnvironment, void *, nullptr, ()); ADDMETHOD_NOBASE_REFRETURN(getGfxCoreHelper, NEO::GfxCoreHelper &, ()); ADDMETHOD_NOBASE_REFRETURN(getL0GfxCoreHelper, L0GfxCoreHelper &, ()); ADDMETHOD_NOBASE_REFRETURN(getProductHelper, NEO::ProductHelper &, ()); @@ -114,9 +113,8 @@ struct MockDeviceImp : public L0::DeviceImp { using Base::subDeviceCopyEngineGroups; using Base::syncDispatchTokenAllocation; - MockDeviceImp(NEO::Device *device, NEO::ExecutionEnvironment *execEnv) { + MockDeviceImp(NEO::Device *device) { device->incRefInternal(); - Base::execEnvironment = execEnv; Base::neoDevice = device; Base::allocationsForReuse = std::make_unique(); } diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.cpp b/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.cpp index 3eac6bc6bb..d417362795 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.cpp +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -21,9 +21,6 @@ ze_result_t MockDeviceForBuiltinTests::MockModuleForBuiltinTests::createKernel(c return ZE_RESULT_SUCCESS; } -MockDeviceForBuiltinTests::MockDeviceForBuiltinTests(NEO::Device *device) : MockDeviceImp(device, device->getExecutionEnvironment()) { -} - ze_result_t MockDeviceForBuiltinTests::createModule(const ze_module_desc_t *desc, ze_module_handle_t *module, ze_module_build_log_handle_t *buildLog, ModuleType type) { diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.h b/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.h index bd8aad203e..7931428a5c 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_built_ins.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,13 +15,12 @@ namespace ult { struct MockDeviceForBuiltinTests : public MockDeviceImp { + using MockDeviceImp::MockDeviceImp; struct MockModuleForBuiltinTests : public ModuleImp { MockModuleForBuiltinTests(Device *device, ModuleType type); ze_result_t createKernel(const ze_kernel_desc_t *desc, ze_kernel_handle_t *kernelHandle) override; }; - MockDeviceForBuiltinTests(NEO::Device *device); - ze_result_t createModule(const ze_module_desc_t *desc, ze_module_handle_t *module, ze_module_build_log_handle_t *buildLog, ModuleType type) override; diff --git a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h index d7be4223af..53478a7b78 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device_for_spirv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,7 +23,7 @@ class MockDeviceForSpv : public MockDeviceImp { std::unique_ptr mockModulePtr; public: - MockDeviceForSpv(NEO::Device *device, NEO::ExecutionEnvironment *ex, L0::DriverHandleImp *driverHandle) : MockDeviceImp(device, ex) { + MockDeviceForSpv(NEO::Device *device, L0::DriverHandleImp *driverHandle) : MockDeviceImp(device) { this->driverHandle = driverHandle; wasModuleCreated = false; } diff --git a/level_zero/core/test/unit_tests/mt_tests/semaphore/test_mt_semaphore.cpp b/level_zero/core/test/unit_tests/mt_tests/semaphore/test_mt_semaphore.cpp index 67e170c4ea..ac79b0d02e 100644 --- a/level_zero/core/test/unit_tests/mt_tests/semaphore/test_mt_semaphore.cpp +++ b/level_zero/core/test/unit_tests/mt_tests/semaphore/test_mt_semaphore.cpp @@ -105,7 +105,7 @@ HWTEST_F(ExternalSemaphoreMTTest, givenSemaphoreSignalOperationEventWhenExternal externalSemaphore->neoExternalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -134,7 +134,7 @@ HWTEST_F(ExternalSemaphoreMTTest, givenHostSynchronizeFailsWhenExternalSemaphore externalSemaphore->neoExternalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -164,7 +164,7 @@ HWTEST_F(ExternalSemaphoreMTTest, givenHostSynchronizeFailsWhenExternalSemaphore HWTEST_F(ExternalSemaphoreMTTest, givenNEOExternalSemaphoreWhenAppendWaitExternalSemaphoresExpIsCalledThenExpectedSemaphoreStateIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); externalSemaphore->neoExternalSemaphore = std::make_unique(); diff --git a/level_zero/core/test/unit_tests/mt_tests/semaphore/windows/test_mt_semaphore_windows.cpp b/level_zero/core/test/unit_tests/mt_tests/semaphore/windows/test_mt_semaphore_windows.cpp index e6015dcdf6..1bbd274453 100644 --- a/level_zero/core/test/unit_tests/mt_tests/semaphore/windows/test_mt_semaphore_windows.cpp +++ b/level_zero/core/test/unit_tests/mt_tests/semaphore/windows/test_mt_semaphore_windows.cpp @@ -48,7 +48,7 @@ using WddmExternalSemaphoreMTTest = Test; using MockDriverHandleImp = Mock; HWTEST_F(WddmExternalSemaphoreMTTest, givenValidExternalSemaphoreWhenImportExternalSemaphoreExpIsCalledThenSuccessIsReturned) { - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); ze_external_semaphore_ext_desc_t desc = {}; ze_external_semaphore_ext_handle_t hSemaphore; @@ -72,7 +72,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenValidExternalSemaphoreWhenImportExter } HWTEST_F(WddmExternalSemaphoreMTTest, givenValidTimelineSemaphoreWhenImportExternalSemaphoreIsCalledThenSuccessIsReturned) { - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); ze_external_semaphore_ext_desc_t desc = {}; ze_external_semaphore_ext_handle_t hSemaphore; @@ -127,7 +127,7 @@ class MockExternalSemaphoreEvent : public MockEvent { HWTEST_F(WddmExternalSemaphoreMTTest, givenEnqueueSignalFailsWhenExternalSemaphoreControllerIsRunningThenExpectedStateIsReturned) { auto mockGdi = new MockFailGdi(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -173,7 +173,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenEnqueueSignalFailsWhenExternalSemapho HWTEST_F(WddmExternalSemaphoreMTTest, givenSemaphoreSignalOperationEventWhenExternalSemaphoreControllerIsRunningThenExpectedStateIsReturned) { auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -221,7 +221,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenImmediateCommandListWhenAppendWaitExt HANDLE extSemaphoreHandle = 0; auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -266,7 +266,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenRegularCommandListWhenAppendWaitExter HANDLE extSemaphoreHandle = 0; auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -328,7 +328,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenInternalProxyEventFailsToAppendWhenAp HANDLE extSemaphoreHandle = 0; auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -369,7 +369,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenWaitEventFailsToAppendWhenAppendWaitE HANDLE extSemaphoreHandle = 0; auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -411,7 +411,7 @@ HWTEST_F(WddmExternalSemaphoreMTTest, givenSignalEventFailsWhenAppendWaitExterna HANDLE extSemaphoreHandle = 0; auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); diff --git a/level_zero/core/test/unit_tests/sources/assert/test_assert.cpp b/level_zero/core/test/unit_tests/sources/assert/test_assert.cpp index 10eda1089f..7a0619ca5c 100644 --- a/level_zero/core/test/unit_tests/sources/assert/test_assert.cpp +++ b/level_zero/core/test/unit_tests/sources/assert/test_assert.cpp @@ -33,7 +33,7 @@ using CommandListImmediateWithAssert = Test; TEST(KernelAssert, GivenKernelWithAssertWhenDestroyedThenAssertIsChecked) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); auto assertHandler = new MockAssertHandler(neoDevice); neoDevice->getRootDeviceEnvironmentRef().assertHandler.reset(assertHandler); @@ -52,7 +52,7 @@ TEST(KernelAssert, GivenKernelWithAssertWhenDestroyedThenAssertIsChecked) { TEST(KernelAssert, GivenKernelWithAssertWhenNoModuleAssignedAndKernelDestroyedThenAssertIsNotChecked) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); auto assertHandler = new MockAssertHandler(neoDevice); neoDevice->getRootDeviceEnvironmentRef().assertHandler.reset(assertHandler); @@ -68,7 +68,7 @@ TEST(KernelAssert, GivenKernelWithAssertWhenNoModuleAssignedAndKernelDestroyedTh TEST(KernelAssert, GivenKernelWithAssertWhenNoAssertHandlerOnDestroyThenDestructorDoesNotCrash) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); Mock module(&l0Device, nullptr, ModuleType::user); @@ -82,7 +82,7 @@ TEST(KernelAssert, GivenKernelWithAssertWhenNoAssertHandlerOnDestroyThenDestruct TEST(KernelAssert, GivenKernelWithAssertWhenSettingAssertBufferThenAssertBufferIsAddedToResidencyAndCrossThreadDataPatched) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); auto assertHandler = new MockAssertHandler(neoDevice); neoDevice->getRootDeviceEnvironmentRef().assertHandler.reset(assertHandler); @@ -107,7 +107,7 @@ TEST(KernelAssert, GivenKernelWithAssertWhenSettingAssertBufferThenAssertBufferI TEST(KernelAssert, GivenKernelWithAssertAndImplicitArgsWhenInitializingKernelThenImplicitArgsAssertBufferPtrIsSet) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); auto assertHandler = new MockAssertHandler(neoDevice); neoDevice->getRootDeviceEnvironmentRef().assertHandler.reset(assertHandler); @@ -146,7 +146,7 @@ TEST(KernelAssert, GivenKernelWithAssertAndImplicitArgsWhenInitializingKernelThe TEST(KernelAssert, GivenNoAssertHandlerWhenKernelWithAssertSetsAssertBufferThenAssertHandlerIsCreated) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); Mock module(&l0Device, nullptr, ModuleType::user); Mock kernel; @@ -164,7 +164,7 @@ TEST(KernelAssert, GivenNoAssertHandlerWhenKernelWithAssertSetsAssertBufferThenA TEST(CommandListAssertTest, GivenCmdListWhenKernelWithAssertAppendedThenHasKernelWithAssertIsSetTrue) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); ze_result_t returnValue; Mock module(&l0Device, nullptr, ModuleType::user); @@ -185,7 +185,7 @@ TEST(CommandListAssertTest, GivenCmdListWhenKernelWithAssertAppendedThenHasKerne TEST(CommandListAssertTest, GivenCmdListWithAppendedAssertKernelWhenResetThenKernelWithAssertAppendedIsFalse) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); ze_result_t returnValue; std::unique_ptr> commandList(ult::CommandList::whiteboxCast(CommandList::create(NEO::defaultHwInfo->platform.eProductFamily, diff --git a/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp b/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp index d18ff9e8ff..de3d155047 100644 --- a/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp @@ -50,7 +50,7 @@ class BuiltinFunctionsLibFixture : public DeviceFixture { void setUp() { DeviceFixture::setUp(); - mockDevicePtr = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), device->getNEODevice()->getExecutionEnvironment(), driverHandle.get())); + mockDevicePtr = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), driverHandle.get())); mockBuiltinFunctionsLibImpl.reset(new MockBuiltinFunctionsLibImpl(mockDevicePtr.get(), neoDevice->getBuiltIns())); mockBuiltinFunctionsLibImpl->ensureInitCompletion(); EXPECT_TRUE(mockBuiltinFunctionsLibImpl->initAsyncComplete); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp index e38dca34ea..31def4e2a3 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp @@ -215,7 +215,7 @@ class DeviceHostPtrFailMock : public MockDeviceImp { }; HWTEST_F(CommandListCreateTests, givenGetAlignedAllocationCalledWithInvalidPtrThenNullptrReturned) { - auto failDevice = std::make_unique(device->getNEODevice(), execEnv); + auto failDevice = std::make_unique(device->getNEODevice()); failDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(failDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1499,7 +1499,7 @@ class MyDeviceMock : public MockDeviceImp { }; HWTEST_F(CommandListCreateTests, givenHostPtrAllocAllocWhenInternalMemCreatedThenNewAllocAddedToDealocationContainer) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice()); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1514,7 +1514,7 @@ HWTEST_F(CommandListCreateTests, givenHostPtrAllocAllocWhenInternalMemCreatedThe } HWTEST_F(CommandListCreateTests, givenHostPtrAllocAllocWhenExternalMemCreatedThenNewAllocAddedToHostPtrMap) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice()); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1529,7 +1529,7 @@ HWTEST_F(CommandListCreateTests, givenHostPtrAllocAllocWhenExternalMemCreatedThe } HWTEST_F(CommandListCreateWithBcs, givenHostPtrAllocAllocAndImmediateCmdListWhenExternalMemCreatedThenNewAllocAddedToInternalAllocationStorage) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice()); myDevice->neoDevice = device->getNEODevice(); CommandStreamReceiver *csr = neoDevice->getInternalCopyEngine() ? neoDevice->getInternalCopyEngine()->commandStreamReceiver : neoDevice->getInternalEngine().commandStreamReceiver; ze_command_queue_desc_t desc = {}; @@ -1552,7 +1552,7 @@ HWTEST_F(CommandListCreateWithBcs, givenHostPtrAllocAllocAndImmediateCmdListWhen } HWTEST_F(CommandListCreateTests, givenGetAlignedAllocationWhenInternalMemWithinDifferentAllocThenReturnNewAlloc) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice()); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); @@ -1566,7 +1566,7 @@ HWTEST_F(CommandListCreateTests, givenGetAlignedAllocationWhenInternalMemWithinD commandList->commandContainer.getDeallocationContainer().clear(); } HWTEST_F(CommandListCreateTests, givenGetAlignedAllocationWhenExternalMemWithinDifferentAllocThenReturnPreviouslyAllocatedMem) { - auto myDevice = std::make_unique>(device->getNEODevice(), execEnv); + auto myDevice = std::make_unique>(device->getNEODevice()); myDevice->neoDevice = device->getNEODevice(); auto commandList = std::make_unique>>(); commandList->initialize(myDevice.get(), NEO::EngineGroupType::copy, 0u); diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp index f2e81f2784..70a567b66b 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_5.cpp @@ -61,7 +61,7 @@ using AppendQueryKernelTimestamps = CommandListCreate; HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimestampsWithoutOffsetsThenProperBuiltinWasAdded) { USE_REAL_FILE_SYSTEM(); - std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), device->getNEODevice()->getExecutionEnvironment(), driverHandle.get())); + std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), driverHandle.get())); testDevice->builtins.reset(new MockBuiltinFunctionsLibImplTimestamps(testDevice.get(), testDevice->getNEODevice()->getBuiltIns())); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestamps); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestampsWithOffsets); @@ -126,7 +126,7 @@ HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimes HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimestampsWithOffsetsThenProperBuiltinWasAdded) { USE_REAL_FILE_SYSTEM(); - std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), device->getNEODevice()->getExecutionEnvironment(), driverHandle.get())); + std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), driverHandle.get())); testDevice->builtins.reset(new MockBuiltinFunctionsLibImplTimestamps(testDevice.get(), testDevice->getNEODevice()->getBuiltIns())); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestamps); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestampsWithOffsets); @@ -193,7 +193,7 @@ HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimes HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimestampsInUsmHostMemoryWithEventsNumberBiggerThanMaxWorkItemSizeThenProperGroupSizeAndGroupCountIsSet) { USE_REAL_FILE_SYSTEM(); - std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), device->getNEODevice()->getExecutionEnvironment(), driverHandle.get())); + std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), driverHandle.get())); testDevice->builtins.reset(new MockBuiltinFunctionsLibImplTimestamps(testDevice.get(), testDevice->getNEODevice()->getBuiltIns())); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestamps); @@ -252,7 +252,7 @@ HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimes HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimestampsInExternalHostMemoryWithEventsNumberBiggerThanMaxWorkItemSizeThenProperGroupSizeAndGroupCountIsSet) { USE_REAL_FILE_SYSTEM(); - std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), device->getNEODevice()->getExecutionEnvironment(), driverHandle.get())); + std::unique_ptr> testDevice = std::unique_ptr>(new MockDeviceForSpv(device->getNEODevice(), driverHandle.get())); testDevice->builtins.reset(new MockBuiltinFunctionsLibImplTimestamps(testDevice.get(), testDevice->getNEODevice()->getBuiltIns())); testDevice->getBuiltinFunctionsLib()->initBuiltinKernel(L0::Builtin::queryKernelTimestamps); @@ -348,7 +348,6 @@ HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimes void initialize(L0::Device *device) { neoDevice = device->getNEODevice(); neoDevice->incRefInternal(); - execEnvironment = device->getExecEnvironment(); driverHandle = device->getDriverHandle(); tmpMockBultinLib = new MockBuiltinFunctionsForQueryKernelTimestamps{this, device->getNEODevice()->getBuiltIns()}; } @@ -437,7 +436,6 @@ HWTEST_F(AppendQueryKernelTimestamps, givenCommandListWhenAppendQueryKernelTimes void initialize(L0::Device *device) { neoDevice = device->getNEODevice(); neoDevice->incRefInternal(); - execEnvironment = device->getExecEnvironment(); driverHandle = device->getDriverHandle(); tmpMockBultinLib = new MockBuiltinFunctionsForQueryKernelTimestamps{this, device->getNEODevice()->getBuiltIns()}; } @@ -532,7 +530,6 @@ HWTEST_F(AppendQueryKernelTimestamps, givenEventWhenAppendQueryIsCalledThenSetAl void initialize(L0::Device *device) { neoDevice = device->getNEODevice(); neoDevice->incRefInternal(); - execEnvironment = device->getExecEnvironment(); driverHandle = device->getDriverHandle(); tmpMockBultinLib = std::make_unique(this, device->getNEODevice()->getBuiltIns()); } @@ -3397,7 +3394,7 @@ HWTEST2_F(CommandListStateBaseAddressPrivateHeapTest, DebugManagerStateRestore restorer; debugManager.flags.ContextGroupSize.set(0); NEO::MockDevice *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); auto &csr = mockNeoDevice->getUltCommandStreamReceiver(); auto &csrStream = csr.commandStream; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp index e19763aec5..5a9666dbdd 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_6.cpp @@ -2962,7 +2962,7 @@ HWTEST2_F(ContextGroupStateBaseAddressGlobalStatelessTest, auto neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); l0Device.setDriverHandle(device->getDriverHandle()); auto defaultCsr = neoDevice->getDefaultEngine().commandStreamReceiver; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp index 852beb0cd2..1ee6b2fad3 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_7.cpp @@ -241,7 +241,7 @@ TEST_F(CommandListCreate, givenRootDeviceAndImplicitScalingDisabledWhenCreatingC subDevice0.getRegularEngineGroups().back().engines.resize(1); subDevice0.getRegularEngineGroups().back().engines[0].commandStreamReceiver = &rootDevice.getGpgpuCommandStreamReceiver(); auto ordinal = static_cast(subDevice0.getRegularEngineGroups().size() - 1); - MockDeviceImp l0RootDevice(&rootDevice, rootDevice.getExecutionEnvironment()); + MockDeviceImp l0RootDevice(&rootDevice); ze_command_list_handle_t commandList = nullptr; ze_command_list_desc_t cmdDesc = {ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC}; 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 dd2eab32ad..1fd9d2361c 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 @@ -93,7 +93,7 @@ HWTEST_F(ContextCreateCommandQueueTest, givenRootDeviceAndImplicitScalingDisable subDevice0.getRegularEngineGroups().back().engines.resize(1); subDevice0.getRegularEngineGroups().back().engines[0].commandStreamReceiver = &rootDevice.getGpgpuCommandStreamReceiver(); auto ordinal = static_cast(subDevice0.getRegularEngineGroups().size() - 1); - MockDeviceImp l0RootDevice(&rootDevice, rootDevice.getExecutionEnvironment()); + MockDeviceImp l0RootDevice(&rootDevice); l0RootDevice.driverHandle = driverHandle.get(); @@ -870,7 +870,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceThenP csr.initializeTagAllocation(); csr.setupContext(*neoDevice->getDefaultEngine().osContext); - NEO::ExecutionEnvironment *execEnv = static_cast(device->getExecEnvironment()); + NEO::ExecutionEnvironment *execEnv = neoDevice->getExecutionEnvironment(); std::unique_ptr scratchController = std::make_unique(device->getRootDeviceIndex(), *execEnv, *csr.getInternalAllocationStorage()); @@ -927,7 +927,7 @@ HWTEST2_F(CommandQueueScratchTests, givenCommandQueueWhenHandleScratchSpaceAndHe csr.initializeTagAllocation(); csr.setupContext(*neoDevice->getDefaultEngine().osContext); - NEO::ExecutionEnvironment *execEnv = static_cast(device->getExecEnvironment()); + NEO::ExecutionEnvironment *execEnv = neoDevice->getExecutionEnvironment(); std::unique_ptr scratchController = std::make_unique(device->getRootDeviceIndex(), *execEnv, *csr.getInternalAllocationStorage()); diff --git a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp index 63e729494c..37fc15946a 100644 --- a/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdqueue/test_cmdqueue_enqueue_cmdlist.cpp @@ -549,7 +549,7 @@ HWTEST2_F(CommandQueueExecuteCommandListsImplicitScalingDisabled, givenCommandLi MockCsr *pMockCsr = new MockCsr{*pNeoDevice->getExecutionEnvironment(), pNeoDevice->getRootDeviceIndex(), pNeoDevice->getDeviceBitfield()}; pNeoDevice->resetCommandStreamReceiver(pMockCsr); - MockDeviceImp device{pNeoDevice, pNeoDevice->getExecutionEnvironment()}; + MockDeviceImp device{pNeoDevice}; auto pCommandQueue = new MockCommandQueueHw{&device, pMockCsr, &desc}; pCommandQueue->initialize(false, false, false); diff --git a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp index f7344949b8..0420fa60ed 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp @@ -906,7 +906,7 @@ TEST_F(DeviceTest, whenCreatingDeviceThenCreateInOrderCounterAllocatorOnDemandAn auto hostAllocator = new MockHostTagAllocator(0, neoMockDevice->getMemoryManager(), destructorId); auto tsAllocator = new MockTsAllocator(0, neoMockDevice->getMemoryManager(), destructorId); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); deviceImp.deviceInOrderCounterAllocator.reset(deviceAllocator); deviceImp.hostInOrderCounterAllocator.reset(hostAllocator); deviceImp.inOrderTimestampAllocator.reset(tsAllocator); @@ -926,7 +926,7 @@ HWTEST_F(DeviceTest, givenTsAllocatorWhenGettingNewTagThenDoInitialize) { auto *neoMockDevice = new NEO::MockDevice(executionEnvironment, rootDeviceIndex); neoMockDevice->createDeviceImpl(); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); auto allocator = deviceImp.getInOrderTimestampAllocator(); @@ -1058,7 +1058,7 @@ HWTEST2_F(DeviceTest, givenAllThreadArbitrationPoliciesWhenPassingSchedulingHint auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); NEO::RAIIProductHelperFactory> raii(*neoMockDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]); raii.mockProductHelper->threadArbPolicies = {ThreadArbitrationPolicy::AgeBased, @@ -1089,7 +1089,7 @@ HWTEST2_F(DeviceTest, givenIncorrectThreadArbitrationPolicyWhenPassingScheduling auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); NEO::RAIIProductHelperFactory> raii(*neoMockDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]); raii.mockProductHelper->threadArbPolicies = {ThreadArbitrationPolicy::NotPresent}; @@ -3734,7 +3734,7 @@ TEST_F(MultipleDevicesDisabledImplicitScalingTest, givenQueryPeerStatsCalledThen TEST_F(MultipleDevicesTest, givenDeviceFailsAppendMemoryCopyThenCanAccessPeerReturnsFalse) { struct MockDeviceFail : public MockDeviceImp { - MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice(), static_cast(device->getExecEnvironment())) { + MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice()) { this->driverHandle = device->getDriverHandle(); this->commandList.appendMemoryCopyResult = ZE_RESULT_ERROR_UNKNOWN; } @@ -3796,7 +3796,7 @@ TEST_F(MultipleDevicesTest, givenDeviceFailsExecuteCommandListThenCanAccessPeerR override { return ZE_RESULT_ERROR_UNKNOWN; } }; - MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice(), static_cast(device->getExecEnvironment())) { + MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice()) { this->driverHandle = device->getDriverHandle(); } @@ -3856,7 +3856,7 @@ TEST_F(MultipleDevicesTest, givenQueryPeerStatsReturningBandwidthZeroAndDeviceFa override { return ZE_RESULT_ERROR_UNKNOWN; } }; - MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice(), static_cast(device->getExecEnvironment())) { + MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice()) { this->driverHandle = device->getDriverHandle(); } @@ -3918,7 +3918,7 @@ TEST_F(MultipleDevicesTest, givenQueryPeerStatsReturningBandwidthNonZeroAndDevic } }; - MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice(), static_cast(device->getExecEnvironment())) { + MockDeviceFail(L0::Device *device) : MockDeviceImp(device->getNEODevice()) { this->driverHandle = device->getDriverHandle(); } @@ -4726,7 +4726,7 @@ HWTEST_F(DeviceTest, givenCooperativeDispatchSupportedWhenQueryingPropertiesFlag hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); MockExecutionEnvironment mockExecutionEnvironment{&hwInfo}; RAIIGfxCoreHelperFactory raii(*neoMockDevice->executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]); @@ -4803,7 +4803,7 @@ HWTEST_F(DeviceTest, givenContextGroupSupportedWhenGettingLowPriorityCsrThenCorr { MockExecutionEnvironment *executionEnvironment = new MockExecutionEnvironment{&hwInfo}; auto *neoMockDevice = NEO::MockDevice::createWithExecutionEnvironment(&hwInfo, executionEnvironment, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); NEO::CommandStreamReceiver *lowPriorityCsr = nullptr; auto result = deviceImp.getCsrForLowPriority(&lowPriorityCsr, false); @@ -4887,7 +4887,7 @@ HWTEST_F(DeviceTest, givenContextGroupSupportedWhenGettingHighPriorityCsrThenCor { MockExecutionEnvironment *executionEnvironment = new MockExecutionEnvironment{&hwInfo}; auto *neoMockDevice = NEO::MockDevice::createWithExecutionEnvironment(&hwInfo, executionEnvironment, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); NEO::CommandStreamReceiver *highPriorityCsr = nullptr; NEO::CommandStreamReceiver *highPriorityCsr2 = nullptr; @@ -5043,7 +5043,7 @@ HWTEST2_F(DeviceTest, givenHpCopyEngineWhenGettingHighPriorityCsrThenCorrectCsrA { MockExecutionEnvironment *executionEnvironment = new MockExecutionEnvironment{&hwInfo}; auto *neoMockDevice = NEO::MockDevice::createWithExecutionEnvironment(&hwInfo, executionEnvironment, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); NEO::CommandStreamReceiver *highPriorityCsr = nullptr; @@ -6701,7 +6701,7 @@ class Mock2DTransposeDevice : public MockDeviceImp { TEST(ExtensionLookupTest, given2DBlockLoadFalseAnd2DBlockStoreFalseThenFlagsIndicateSupportsNeither) { auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get(), 0); - Mock2DTransposeDevice deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + Mock2DTransposeDevice deviceImp(neoMockDevice); ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; ze_intel_device_block_array_exp_properties_t blockArrayProps = {ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES}; @@ -6716,7 +6716,7 @@ TEST(ExtensionLookupTest, given2DBlockLoadFalseAnd2DBlockStoreFalseThenFlagsIndi TEST(ExtensionLookupTest, given2DBlockLoadTrueAnd2DBlockStoreFalseThenFlagsIndicateSupportLoad) { auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get(), 0); - Mock2DTransposeDevice deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + Mock2DTransposeDevice deviceImp(neoMockDevice); ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; ze_intel_device_block_array_exp_properties_t blockArrayProps = {ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES}; @@ -6731,7 +6731,7 @@ TEST(ExtensionLookupTest, given2DBlockLoadTrueAnd2DBlockStoreFalseThenFlagsIndic TEST(ExtensionLookupTest, given2DBlockLoadFalseAnd2DBlockStoreTrueThenFlagsIndicateSupportStore) { auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get(), 0); - Mock2DTransposeDevice deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + Mock2DTransposeDevice deviceImp(neoMockDevice); ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; ze_intel_device_block_array_exp_properties_t blockArrayProps = {ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES}; @@ -6746,7 +6746,7 @@ TEST(ExtensionLookupTest, given2DBlockLoadFalseAnd2DBlockStoreTrueThenFlagsIndic TEST(ExtensionLookupTest, given2DBlockLoadTrueAnd2DBlockStoreTrueThenFlagsIndicateSupportBoth) { auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get(), 0); - Mock2DTransposeDevice deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + Mock2DTransposeDevice deviceImp(neoMockDevice); ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES}; ze_intel_device_block_array_exp_properties_t blockArrayProps = {ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES}; 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 d2b5a5857a..ad585dc6fc 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 @@ -3845,7 +3845,7 @@ HWTEST_F(PrintfHandlerTests, givenKernelWithPrintfWhenPrintingOutputWithBlitterU auto device = std::unique_ptr(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); auto kernelInfo = std::make_unique(); kernelInfo->heapInfo.kernelHeapSize = 1; @@ -3905,7 +3905,7 @@ HWTEST_F(PrintfHandlerTests, givenPrintDebugMessagesAndKernelWithPrintfWhenBlitt GTEST_SKIP(); } device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); auto bcsCsr = static_cast *>(bcsEngine->commandStreamReceiver); bcsCsr->callBaseFlushBcsTask = false; @@ -4343,7 +4343,7 @@ TEST(KernelImmutableDataTest, givenBindlessKernelWhenInitializingImmDataThenSshT auto device = std::unique_ptr(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); auto kernelInfo = std::make_unique(); kernelInfo->heapInfo.kernelHeapSize = 1; diff --git a/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp b/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp index 12109ddf75..861c65e6d7 100644 --- a/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp +++ b/level_zero/core/test/unit_tests/sources/kernel/test_kernel_2.cpp @@ -592,7 +592,7 @@ HWTEST2_F(KernelImmutableDataBindlessTest, givenGlobalConstBufferAndBindlessExpl { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); uint64_t gpuAddress = 0x1200; void *buffer = reinterpret_cast(gpuAddress); @@ -662,7 +662,7 @@ HWTEST2_F(KernelImmutableDataBindlessTest, givenGlobalVarBufferAndBindlessExplic { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); uint64_t gpuAddress = 0x1200; void *buffer = reinterpret_cast(gpuAddress); @@ -736,7 +736,7 @@ HWTEST2_F(KernelImmutableDataBindlessTest, givenGlobalConstBufferAndBindlessExpl { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); uint64_t gpuAddress = 0x1200; void *buffer = reinterpret_cast(gpuAddress); @@ -821,7 +821,7 @@ HWTEST2_F(KernelImmutableDataBindlessTest, givenGlobalVarBufferAndBindlessExplic { device->incRefInternal(); - MockDeviceImp deviceImp(device.get(), device->getExecutionEnvironment()); + MockDeviceImp deviceImp(device.get()); uint64_t gpuAddress = 0x1200; void *buffer = reinterpret_cast(gpuAddress); 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 5e3e4ee8f2..da6d6e68f0 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 @@ -266,7 +266,7 @@ HWTEST_F(ModuleTest, givenBlitterAvailableWhenCopyingPatchedSegmentsThenIsaIsTra &NEO::BlitHelperFunctions::blitMemoryToAllocation, mockBlitMemoryToAllocation); auto *neoMockDevice = NEO::MockDevice::createWithExecutionEnvironment(&hwInfo, executionEnvironment, 0); - MockDeviceImp device(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp device(neoMockDevice); device.driverHandle = driverHandle.get(); auto zebinData = std::make_unique(device.getHwInfo()); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module_2.cpp b/level_zero/core/test/unit_tests/sources/module/test_module_2.cpp index eee2c7136c..a40605c898 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module_2.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module_2.cpp @@ -88,7 +88,7 @@ TEST(ModuleDestroyTest, givenIsaAllocationWhenIsModuleDestroyedThenRequireInstru auto mockCommandStreamReceiver = static_cast(&neoMockDevice->getGpgpuCommandStreamReceiver()); mockCommandStreamReceiver->makeResidentParentCall = true; - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); auto module = new MockModule{&deviceImp, nullptr, ModuleType::user}; module->translationUnit.reset(new MockModuleTranslationUnit{&deviceImp}); @@ -118,7 +118,7 @@ TEST(ModuleDestroyTest, givenKernelImmutableDataWithNullIsaAllocationWhenIsModul auto mockCommandStreamReceiver = static_cast(&neoMockDevice->getGpgpuCommandStreamReceiver()); mockCommandStreamReceiver->makeResidentParentCall = true; - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); auto module = new MockModule{&deviceImp, nullptr, ModuleType::user}; module->translationUnit.reset(new MockModuleTranslationUnit{&deviceImp}); diff --git a/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp b/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp index 7a1d34215d..1b47f9fe61 100644 --- a/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp +++ b/level_zero/core/test/unit_tests/sources/printf_handler/test_printf_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Intel Corporation + * Copyright (C) 2020-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,7 +16,7 @@ namespace ult { TEST(PrintfHandler, whenPrintfBufferIscreatedThenCorrectAllocationTypeIsUsed) { NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); auto allocation = PrintfHandler::createPrintfBuffer(&l0Device); EXPECT_EQ(NEO::AllocationType::printfSurface, allocation->getAllocationType()); diff --git a/level_zero/core/test/unit_tests/sources/semaphore/linux/test_semaphore_linux.cpp b/level_zero/core/test/unit_tests/sources/semaphore/linux/test_semaphore_linux.cpp index 6930e1c0ed..5a2f80b2c6 100644 --- a/level_zero/core/test/unit_tests/sources/semaphore/linux/test_semaphore_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/semaphore/linux/test_semaphore_linux.cpp @@ -46,7 +46,7 @@ class DrmSemaphoreFixture : public DeviceFixture { using DrmExternalSemaphoreTest = Test; HWTEST_F(DrmExternalSemaphoreTest, givenDriverModelDrmWhenImportExternalSemaphoreExpIsCalledThenUnsupportedFeatureIsReturned) { - MockDeviceImp l0Device(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(neoDevice); ze_external_semaphore_ext_desc_t desc = {}; ze_external_semaphore_ext_handle_t hSemaphore; int fd = 0; diff --git a/level_zero/core/test/unit_tests/sources/semaphore/test_semaphore.cpp b/level_zero/core/test/unit_tests/sources/semaphore/test_semaphore.cpp index 7bb2132de7..a9b172c94e 100644 --- a/level_zero/core/test/unit_tests/sources/semaphore/test_semaphore.cpp +++ b/level_zero/core/test/unit_tests/sources/semaphore/test_semaphore.cpp @@ -125,7 +125,7 @@ using MockDriverHandleImp = Mock; HWTEST_F(ExternalSemaphoreTest, givenImmediateCommandListWhenAppendSignalExternalSemaphoresExpIsCalledThenSuccessIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -155,7 +155,7 @@ HWTEST_F(ExternalSemaphoreTest, givenImmediateCommandListWhenAppendSignalExterna HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnEventFailsWhenAppendSignalExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -187,7 +187,7 @@ HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnEventFailsWhenAppendSignalExter HWTEST_F(ExternalSemaphoreTest, givenAppendSignalInternalProxyEventFailsWhenAppendSignalExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -218,7 +218,7 @@ HWTEST_F(ExternalSemaphoreTest, givenAppendSignalInternalProxyEventFailsWhenAppe HWTEST_F(ExternalSemaphoreTest, givenAppendSignalEventFailsWhenAppendSignalExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -254,7 +254,7 @@ HWTEST_F(ExternalSemaphoreTest, givenFailingMemoryManagerWhenAppendSignalExterna auto externalSemaphore = std::make_unique(); auto failMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(failMemoryManager.get()); @@ -284,7 +284,7 @@ HWTEST_F(ExternalSemaphoreTest, givenFailingMemoryManagerWhenAppendSignalExterna HWTEST_F(ExternalSemaphoreTest, givenImmediateCommandListWhenAppendWaitExternalSemaphoresExpIsCalledThenSuccessIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -313,7 +313,7 @@ HWTEST_F(ExternalSemaphoreTest, givenImmediateCommandListWhenAppendWaitExternalS HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnEventFailsWhenAppendWaitExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -343,7 +343,7 @@ HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnEventFailsWhenAppendWaitExterna HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnInternalProxyEventFailsWhenAppendWaitExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -373,7 +373,7 @@ HWTEST_F(ExternalSemaphoreTest, givenAppendWaitOnInternalProxyEventFailsWhenAppe HWTEST_F(ExternalSemaphoreTest, givenAppendSignalEventFailsWhenAppendWaitExternalSemaphoresExpIsCalledThenErrorIsReturned) { auto externalSemaphore = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); @@ -408,7 +408,7 @@ HWTEST_F(ExternalSemaphoreTest, givenFailingMemoryManagerWhenAppendWaitExternalS auto externalSemaphore = std::make_unique(); auto failMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(failMemoryManager.get()); @@ -440,7 +440,7 @@ HWTEST_F(ExternalSemaphoreTest, givenExternalSemaphoreControllerWhenAllocateProx auto externalSemaphore2 = std::make_unique(); auto mockMemoryManager = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); l0Device->setDriverHandle(driverHandleImp.get()); @@ -465,7 +465,7 @@ HWTEST_F(ExternalSemaphoreTest, givenMaxEventsInPoolCreatedWhenAllocateProxyEven auto externalSemaphore1 = std::make_unique(); auto externalSemaphore2 = std::make_unique(); - auto l0Device = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + auto l0Device = std::make_unique(neoDevice); auto mockMemoryManager = std::make_unique(); auto driverHandleImp = std::make_unique(); driverHandleImp->setMemoryManager(mockMemoryManager.get()); diff --git a/level_zero/core/test/unit_tests/xe2_hpg_core/test_device_xe2_hpg_core.cpp b/level_zero/core/test/unit_tests/xe2_hpg_core/test_device_xe2_hpg_core.cpp index 1c2cd10b03..18836639f5 100644 --- a/level_zero/core/test/unit_tests/xe2_hpg_core/test_device_xe2_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe2_hpg_core/test_device_xe2_hpg_core.cpp @@ -55,7 +55,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndNoCCSThenOneQueueGroupI hwInfo.featureTable.flags.ftrCCSNode = false; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -69,7 +69,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndCCSThenTwoQueueGroupsAr hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -84,7 +84,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportAndCCSThenFourQueueGroupsAre hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -130,7 +130,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportCCSAndLinkedBcsDisabledThenT hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -173,7 +173,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterDisabledAndAllBcsSetThenTwoQueueGro hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -205,7 +205,7 @@ HWTEST2_F(DeviceCopyQueueGroupXe2HpgCoreTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -239,7 +239,7 @@ HWTEST2_P(CommandQueueGroupTestXe2HpgCore, givenVaryingBlitterSupportAndCCSThenB hwInfo.featureTable.ftrBcsInfo = maxNBitValue(2); hwInfo.featureTable.ftrBcsInfo.set(GetParam()); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); diff --git a/level_zero/core/test/unit_tests/xe2_hpg_core/test_module_xe2_hpg_core.cpp b/level_zero/core/test/unit_tests/xe2_hpg_core/test_module_xe2_hpg_core.cpp index 666edcd8d0..e720174cc7 100644 --- a/level_zero/core/test/unit_tests/xe2_hpg_core/test_module_xe2_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe2_hpg_core/test_module_xe2_hpg_core.cpp @@ -60,7 +60,7 @@ XE2_HPG_CORETEST_F(Xe2KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThre { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = GrfConfig::defaultGrfNumber; @@ -83,7 +83,7 @@ XE2_HPG_CORETEST_F(Xe2KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThre } { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = GrfConfig::largeGrfNumber; diff --git a/level_zero/core/test/unit_tests/xe3_core/test_device_xe3_core.cpp b/level_zero/core/test/unit_tests/xe3_core/test_device_xe3_core.cpp index 3e3d1864b6..f2618dc65a 100644 --- a/level_zero/core/test/unit_tests/xe3_core/test_device_xe3_core.cpp +++ b/level_zero/core/test/unit_tests/xe3_core/test_device_xe3_core.cpp @@ -40,7 +40,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndNoCCSThenOneQueueGroupI hwInfo.featureTable.flags.ftrCCSNode = false; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -54,7 +54,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndCCSThenTwoQueueGroupsAr hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -69,7 +69,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportAndCCSThenFourQueueGroupsAre hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -115,7 +115,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportCCSAndLinkedBcsDisabledThenT hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -158,7 +158,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterDisabledAndAllBcsSetThenTwoQueueGro hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -190,7 +190,7 @@ HWTEST2_F(DeviceCopyQueueGroupXe3CoreTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -224,7 +224,7 @@ HWTEST2_P(CommandQueueGroupTestXe3Core, givenVaryingBlitterSupportAndCCSThenBCSG hwInfo.featureTable.ftrBcsInfo = maxNBitValue(2); hwInfo.featureTable.ftrBcsInfo.set(GetParam()); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); diff --git a/level_zero/core/test/unit_tests/xe3_core/test_module_xe3_core.cpp b/level_zero/core/test/unit_tests/xe3_core/test_module_xe3_core.cpp index 9634849cd6..9bbb3bbdbf 100644 --- a/level_zero/core/test/unit_tests/xe3_core/test_module_xe3_core.cpp +++ b/level_zero/core/test/unit_tests/xe3_core/test_module_xe3_core.cpp @@ -61,7 +61,7 @@ XE3_CORETEST_F(Xe3KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThreadsP { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = 128u; @@ -85,7 +85,7 @@ XE3_CORETEST_F(Xe3KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThreadsP } { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = 160u; @@ -108,7 +108,7 @@ XE3_CORETEST_F(Xe3KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThreadsP } { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = 192u; @@ -131,7 +131,7 @@ XE3_CORETEST_F(Xe3KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThreadsP } { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = 256u; @@ -154,7 +154,7 @@ XE3_CORETEST_F(Xe3KernelSetupTests, givenParamsWhenSetupGroupSizeThenNumThreadsP } { NEO::Device *mockNeoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp l0Device(mockNeoDevice, mockNeoDevice->getExecutionEnvironment()); + MockDeviceImp l0Device(mockNeoDevice); Mock kernel; kernel.descriptor.kernelAttributes.numGrfRequired = 512u; diff --git a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp index 55d62eb8ba..011a29b23e 100644 --- a/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp @@ -445,7 +445,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndNoCCSThenOneQueueGroupI hwInfo.featureTable.flags.ftrCCSNode = false; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -459,7 +459,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndCCSThenTwoQueueGroupsAr hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -475,7 +475,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterDisabledAndAllBcsSetThenTwoQueueGro hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -505,7 +505,7 @@ HWTEST2_F(DeviceCopyQueueGroupXeHpcTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -541,7 +541,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportWithBcsVirtualEnginesEnabled hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -571,7 +571,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportWithBcsVirtualEnginesDisable hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -599,7 +599,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportAndCCSThenFourQueueGroupsAre hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -645,7 +645,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportCCSAndLinkedBcsDisabledThenT hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -699,7 +699,7 @@ HWTEST2_P(CommandQueueGroupTestXeHpc, givenVaryingBlitterSupportAndCCSThenBCSGro hwInfo.featureTable.ftrBcsInfo = maxNBitValue(2); hwInfo.featureTable.ftrBcsInfo.set(GetParam()); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/test_device_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/test_device_xe_hpg_core.cpp index 83ab6ec8e0..0a8a219e0c 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/test_device_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/test_device_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndNoCCSThenOneQueueGroupI hwInfo.featureTable.flags.ftrCCSNode = false; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -36,7 +36,7 @@ HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndCCSThenTwoQueueGroupsAr hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.capabilityTable.blitterOperationsSupported = false; auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -51,7 +51,7 @@ HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportAndCCSThenThreeQueueGroupsAr hwInfo.capabilityTable.blitterOperationsSupported = true; hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); @@ -110,7 +110,7 @@ HWTEST2_F(DeviceCopyQueueGroupXeHpgCoreTest, hwInfo.featureTable.ftrBcsInfo.set(0); auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex); - MockDeviceImp deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoMockDevice); uint32_t count = 0; ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr); diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_registers_access.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_registers_access.cpp index ba651393cf..40c98c58ca 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_registers_access.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_registers_access.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023-2024 Intel Corporation + * Copyright (C) 2023-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,7 @@ void DebugSessionRegistersAccessV3::setUp() { auto hwInfo = *NEO::defaultHwInfo.get(); neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0); - deviceImp = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + deviceImp = std::make_unique(neoDevice); session = std::make_unique(config, deviceImp.get(), true, 3); @@ -36,7 +36,7 @@ void DebugSessionRegistersAccess::setUp() { auto hwInfo = *NEO::defaultHwInfo.get(); neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0); - deviceImp = std::make_unique(neoDevice, neoDevice->getExecutionEnvironment()); + deviceImp = std::make_unique(neoDevice); session = std::make_unique(config, deviceImp.get()); diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp index 2bc2d4a4af..fb8c0c72b2 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_tests.cpp @@ -46,7 +46,7 @@ TEST(DeviceWithDebugSessionTest, GivenSlicesEnabledWithEarlierSlicesDisabledThen hwInfo.gtSystemInfo.SliceInfo[3].Enabled = true; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxDualSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported; EXPECT_EQ(1u, sessionMock->allThreads.count(EuThread::ThreadId(0, 0, numSubslicesPerSlice - 1, 0, 0))); @@ -81,7 +81,7 @@ TEST(DebugSessionTest, givenApplyResumeWaCalledThenWAIsApplied) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); @@ -103,7 +103,7 @@ TEST(DebugSessionTest, givenAllStoppedThreadsWhenInterruptCalledThenErrorNotAvai auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -125,7 +125,7 @@ TEST(DebugSessionTest, givenNoPendingInterruptWhenSendInterruptCalledThenInterru auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->interruptSent = true; @@ -140,7 +140,7 @@ TEST(DebugSessionTest, givenPendingInterruptWhenNewInterruptForThreadCalledThenE auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -158,7 +158,7 @@ TEST(DebugSessionTest, givenInterruptAlreadySentWhenSendInterruptCalledSecondTim auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -186,7 +186,7 @@ TEST(DebugSessionTest, givenInterruptRequestWhenInterruptImpFailsInSendInterrupt auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -213,7 +213,7 @@ TEST(DebugSessionTest, givenPendingInteruptWhenHandlingThreadWithAttentionThenPe auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -263,7 +263,7 @@ TEST(DebugSessionTest, givenPreviouslyStoppedThreadAndPendingInterruptWhenHandli auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -301,7 +301,7 @@ TEST(DebugSessionTest, givenThreadsStoppedOnBreakpointAndInterruptedWhenHandling auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -379,7 +379,7 @@ TEST(DebugSessionTest, givenStoppedThreadWhenAddingNewlyStoppedThenThreadIsNotAd auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -397,7 +397,7 @@ TEST(DebugSessionTest, givenNoPendingInterruptAndStoppedThreadWithForceException auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -418,7 +418,7 @@ TEST(DebugSessionTest, givenNoPendingInterruptAndStoppedThreadWhenGeneratingEven auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -450,7 +450,7 @@ TEST(DebugSessionTest, givenNoStoppedThreadWhenAddingNewlyStoppedThenThreadIsNot auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->threadStopped = 0; @@ -467,7 +467,7 @@ TEST(DebugSessionTest, givenV3SipHeaderWhenCalculatingThreadOffsetThenCorrectRes auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp, true, 3); ze_device_thread_t thread = {0, 0, 0, 0}; @@ -485,7 +485,7 @@ TEST(DebugSessionTest, givenSipHeaderGreaterThan3WhenCalculatingThreadOffsetThen auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp, true, 3); ze_device_thread_t thread = {0, 0, 0, 0}; @@ -502,7 +502,7 @@ TEST(DebugSessionTest, givenStoppedThreadAndNoSrMagicWhenAddingNewlyStoppedThenT auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -537,7 +537,7 @@ TEST(DebugSessionTest, givenStoppedThreadAndValidSrMagicWhenAddingNewlyStoppedTh auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -575,7 +575,7 @@ TEST(DebugSessionTest, givenNoInterruptsSentWhenGenerateEventsAndResumeCalledThe auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -592,7 +592,7 @@ TEST(DebugSessionTest, givenTriggerEventsWhenGenerateEventsAndResumeCalledThenEv auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -629,7 +629,7 @@ TEST(DebugSessionTest, givenPendingInterruptAfterTimeoutWhenGenerateEventsAndRes auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -659,7 +659,7 @@ TEST(DebugSessionTest, givenPendingInterruptBeforeTimeoutWhenGenerateEventsAndRe auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -684,7 +684,7 @@ TEST(DebugSessionTest, givenErrorFromReadSystemRoutineIdentWhenCheckingThreadSta auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->readSystemRoutineIdentRetVal = false; @@ -702,7 +702,7 @@ TEST(DebugSessionTest, givenPendingInterruptsWhenGeneratingEventsThenStoppedEven auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -730,7 +730,7 @@ TEST(DebugSessionTest, givenEmptyStateSaveAreaWhenGetStateSaveAreaCalledThenRead auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); decltype(sessionMock->stateSaveAreaHeader) emptyHeader; @@ -747,7 +747,7 @@ TEST(DebugSessionTest, givenStoppedThreadsWhenFillingResumeAndStoppedThreadsFrom auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -798,7 +798,7 @@ TEST(DebugSessionTest, givenPFThreadWithAIPEqStartIPWhenCallingFillResumeAndStop auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -828,7 +828,7 @@ TEST(DebugSessionTest, givenDbgRegAndCRThenisAIPequalToThreadStartIPReturnsCorre auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->callBaseisAIPequalToThreadStartIP = true; @@ -845,7 +845,7 @@ TEST(DebugSessionTest, givenThreadsStoppedWithPageFaultWhenCallingfillResumeAndS auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -884,7 +884,7 @@ TEST(DebugSessionTest, givenNoThreadsStoppedWhenCallingfillResumeAndStoppedThrea auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); std::vector resumeThreads; @@ -912,7 +912,7 @@ TEST(DebugSessionTest, givenThreadsToResumeWhenResumeAccidentallyStoppedThreadsC auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->skipCheckThreadIsResumed = false; @@ -943,7 +943,7 @@ TEST(DebugSessionTest, givenCr0RegisterWhenIsFEOrFEHOnlyExceptionReasonThenTrueR auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -971,7 +971,7 @@ TEST(DebugSessionTest, givenSomeThreadsRunningWhenResumeCalledThenOnlyStoppedThr auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -1006,7 +1006,7 @@ TEST(DebugSessionTest, givenStoppedThreadsWhenResumeAllCalledThenOnlyReportedSto hwInfo.gtSystemInfo.ThreadCount = 8 * hwInfo.gtSystemInfo.EUCount; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -1053,7 +1053,7 @@ TEST(DebugSessionTest, givenMultipleStoppedThreadsWhenResumeAllCalledThenStateSa hwInfo.gtSystemInfo.ThreadCount = 8 * hwInfo.gtSystemInfo.EUCount; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -1128,7 +1128,7 @@ TEST(DebugSessionTest, givenMultipleStoppedThreadsWhenResumeAllCalledThenStateSa hwInfo.gtSystemInfo.ThreadCount = 8 * hwInfo.gtSystemInfo.EUCount; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); auto pStateSaveAreaHeader = reinterpret_cast(sessionMock->stateSaveAreaHeader.data()); @@ -1180,7 +1180,7 @@ TEST(DebugSessionTest, givenMultipleStoppedThreadsAndInvalidStateSaveAreaWhenRes hwInfo.gtSystemInfo.ThreadCount = 8 * hwInfo.gtSystemInfo.EUCount; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->forceZeroStateSaveAreaSize = true; @@ -1234,7 +1234,7 @@ TEST(DebugSessionTest, givenStoppedThreadWhenResumeCalledThenStoppedThreadsAreCh auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -1255,7 +1255,7 @@ TEST(DebugSessionTest, givenAllThreadsRunningWhenResumeCalledThenErrorUnavailabl auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -1270,7 +1270,7 @@ TEST(DebugSessionTest, givenErrorFromResumeImpWhenResumeCalledThenErrorReturned) auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->resumeImpResult = ZE_RESULT_ERROR_UNKNOWN; @@ -1289,7 +1289,7 @@ TEST(DebugSessionTest, givenErrorFromReadSbaBufferWhenReadSbaRegistersCalledThen auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->readSbaBufferResult = ZE_RESULT_ERROR_UNKNOWN; @@ -1306,7 +1306,7 @@ TEST(DebugSessionTest, givenErrorFromReadRegistersWhenReadSbaRegistersCalledThen auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->readRegistersResult = ZE_RESULT_ERROR_UNKNOWN; @@ -1323,7 +1323,7 @@ HWTEST2_F(DebugSessionTest, givenErrorFromReadMemoryWhenReadSbaRegistersCalledTh auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->readRegistersResult = ZE_RESULT_SUCCESS; @@ -1361,7 +1361,7 @@ TEST(DebugSessionTest, givenNullptrStateSaveAreaGpuVaWhenCallingCheckIsThreadRes auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1381,7 +1381,7 @@ TEST(DebugSessionTest, whenCallingCheckThreadIsResumedWithoutSrMagicThenThreadIs auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1417,7 +1417,7 @@ TEST(DebugSessionTest, givenErrorFromReadSystemRoutineIdentWhenCallingCheckThrea auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1439,7 +1439,7 @@ TEST(DebugSessionTest, givenSipVersion1WhenCallingCheckThreadIsResumedWithSaveAr auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1472,7 +1472,7 @@ TEST(DebugSessionTest, givenSrMagicWithCounterLessThanlLastThreadCounterThenThre auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1507,7 +1507,7 @@ TEST(DebugSessionTest, givenSrMagicWithCounterEqualToPrevousThenThreadHasNotBeen auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1539,7 +1539,7 @@ TEST(DebugSessionTest, givenSrMagicWithCounterBiggerThanPreviousThenThreadIsResu auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1571,7 +1571,7 @@ TEST(DebugSessionTest, givenSrMagicWithCounterOverflowingZeroThenThreadIsResumed auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1594,7 +1594,7 @@ TEST(DebugSessionTest, GivenBindlessSipVersion1AndResumeWARequiredWhenCallingRes auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); @@ -1639,7 +1639,7 @@ TEST(DebugSessionTest, GivenErrorFromReadRegisterWhenResumingThreadThenRegisterI auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); @@ -1686,7 +1686,7 @@ TEST(DebugSessionTest, GivenErrorFromWriteRegisterWhenResumingThreadThenRegister auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); @@ -1732,7 +1732,7 @@ TEST(DebugSessionTest, GivenNonBindlessSipVersion1AndResumeWARequiredWhenCalling auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); @@ -1786,7 +1786,7 @@ TEST(DebugSessionTest, GivenBindlessSipVersion2WhenWritingResumeFailsThenErrorIs config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1831,7 +1831,7 @@ TEST(DebugSessionTest, GivenBindlessSipVersion2WhenResumingThreadThenCheckIfThre config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -1869,7 +1869,7 @@ struct DebugSessionTestSwFifoFixture : public ::testing::Test { config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); session = std::make_unique(config, &deviceImp); stateSaveAreaHeaderPtr = reinterpret_cast(stateSaveAreaHeader.data()); @@ -2050,7 +2050,7 @@ TEST(DebugSessionTest, GivenSwFifoWhenStateSaveAreaVersionIsLessThanThreeDuringF config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); session->stateSaveAreaHeader.clear(); @@ -2069,7 +2069,7 @@ TEST(DebugSessionTest, GivenSwFifoWhenStateSaveAreaVersionIsGreaterThanThreeDuri config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); session->stateSaveAreaHeader.clear(); @@ -2092,7 +2092,7 @@ TEST_F(DebugSessionTest, GivenInvalidSwFifoNodeWhenCheckingIsValidNodeAndOnReadi config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); // Declare node whose valid field is 0 @@ -2113,7 +2113,7 @@ TEST_F(DebugSessionTest, GivenInvalidSwFifoNodeWhenCheckingIsValidNodeAndOnReadi config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); // Declare node whose valid field is 0 @@ -2131,7 +2131,7 @@ TEST_F(DebugSessionTest, givenTssMagicCorruptedWhenStateSaveAreIsReadThenHeaderI config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); session->readMemoryBuffer.resize(stateSaveAreaHeader.size()); @@ -2152,7 +2152,7 @@ TEST_F(DebugSessionTest, givenSsaHeaderVersionGreaterThan3WhenStateSaveAreIsRead config.pid = 0x1234; auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(config, &deviceImp); session->readMemoryBuffer.resize(stateSaveAreaHeader.size()); @@ -2170,7 +2170,7 @@ TEST(DebugSessionTest, givenStoppedThreadWhenGettingNotStoppedThreadsThenOnlyRun auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -2197,7 +2197,7 @@ TEST(DebugSessionTest, givenSizeBiggerThanPreviousWhenAllocatingStateSaveAreaMem auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -2215,7 +2215,7 @@ TEST(DebugSessionTest, givenTheSameSizeWhenAllocatingStateSaveAreaMemoryThenNewM auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3344,7 +3344,7 @@ TEST(DebugSessionTest, GivenStoppedThreadWhenValidAddressesSizesAndOffsetsThenSl auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3409,7 +3409,7 @@ TEST(DebugSessionTest, GivenStoppedThreadWhenUnderInvalidConditionsThenSlmReadFa auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3477,7 +3477,7 @@ TEST(DebugSessionTest, GivenStoppedThreadWhenValidAddressesSizesAndOffsetsThenSl auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3581,7 +3581,7 @@ TEST(DebugSessionTest, GivenStoppedThreadWhenUnderInvalidConditionsThenSlmWriteF auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3647,7 +3647,7 @@ TEST(DebugSessionTest, givenCanonicalOrDecanonizedAddressWhenCheckingValidAddres auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); @@ -3669,7 +3669,7 @@ TEST(DebugSessionTest, givenInvalidAddressWhenCheckingValidAddressThenFalseIsRet auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); auto gmmHelper = neoDevice->getGmmHelper(); @@ -3765,7 +3765,7 @@ TEST(DebugSessionTest, GivenRootDeviceAndTileAttachWhenDebugSessionIsCreatedThen auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp, false); ASSERT_NE(nullptr, sessionMock); diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp index 983e41fa9a..c646a56867 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -163,7 +163,7 @@ TEST(DebugSession, givenSingleThreadWhenGettingSingleThreadsThenCorrectThreadIsR auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); auto subslice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported - 1; @@ -195,7 +195,7 @@ TEST(DebugSession, givenAllThreadsWithLowSliceDisabledWhenGettingSingleThreadsTh hwInfo.gtSystemInfo.SliceInfo[3].Enabled = true; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); ze_device_thread_t physicalThread = {UINT32_MAX, 0, 0, 0}; @@ -219,7 +219,7 @@ TEST(DebugSession, givenAllThreadsWhenGettingSingleThreadsThenCorrectThreadsAreR auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); auto subslice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported - 1; @@ -245,7 +245,7 @@ TEST(DebugSession, givenAllEUsWhenGettingSingleThreadsThenCorrectThreadsAreRetur auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); auto subslice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported - 1; @@ -270,7 +270,7 @@ TEST(DebugSession, givenAllSubslicesWhenGettingSingleThreadsThenCorrectThreadsAr auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); ze_device_thread_t physicalThread = {0, UINT32_MAX, 0, 0}; @@ -294,7 +294,7 @@ TEST(DebugSession, givenAllSlicesWhenGettingSingleThreadsThenCorrectThreadsAreRe auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); ze_device_thread_t physicalThread = {UINT32_MAX, 0, 0, 0}; @@ -319,7 +319,7 @@ TEST(DebugSession, givenBindlessSystemRoutineWhenQueryingIsBindlessThenTrueRetur auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); debugSession->debugArea.reserved1 = 1u; @@ -333,7 +333,7 @@ TEST(DebugSession, givenBindfulSystemRoutineWhenQueryingIsBindlessThenFalseRetur auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); debugSession->debugArea.reserved1 = 0u; @@ -344,7 +344,7 @@ TEST(DebugSession, givenBindfulSystemRoutineWhenQueryingIsBindlessThenFalseRetur TEST(DebugSession, givenApiThreadAndSingleTileWhenConvertingThenCorrectValuesReturned) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ze_device_thread_t thread = {hwInfo.gtSystemInfo.SliceCount - 1, hwInfo.gtSystemInfo.SubSliceCount - 1, 0, 0}; @@ -373,7 +373,7 @@ TEST(DebugSession, givenApiThreadAndSingleTileWhenConvertingThenCorrectValuesRet TEST(DebugSession, givenApiThreadAndSingleTileWhenGettingDeviceIndexThenCorrectIndexIsReturned) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ze_device_thread_t thread = {hwInfo.gtSystemInfo.SliceCount - 1, 0, 0, 0}; @@ -393,7 +393,7 @@ TEST(DebugSession, givenAllStoppedThreadsWhenAreRequestedThreadsStoppedCalledThe auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->initialize(); @@ -413,7 +413,7 @@ TEST(DebugSession, givenSomeStoppedThreadsWhenAreRequestedThreadsStoppedCalledTh auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->initialize(); @@ -432,7 +432,7 @@ TEST(DebugSession, givenSomeStoppedThreadsWhenAreRequestedThreadsStoppedCalledTh TEST(DebugSession, givenApiThreadAndSingleTileWhenFillingDevicesThenVectorEntryIsSet) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ze_device_thread_t thread = {hwInfo.gtSystemInfo.SliceCount - 1, hwInfo.gtSystemInfo.SubSliceCount - 1, 0, 0}; @@ -449,7 +449,7 @@ TEST(DebugSession, givenDifferentCombinationsOfThreadsAndMemoryTypeCheckExpected auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(config, &deviceImp); sessionMock->initialize(); @@ -489,7 +489,7 @@ TEST(DebugSession, givenDifferentCombinationsOfThreadsAndMemoryTypeCheckExpected TEST(DebugSession, givenDifferentThreadsWhenGettingPerThreadScratchOffsetThenCorrectOffsetReturned) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); auto &productHelper = neoDevice->getProductHelper(); @@ -546,7 +546,7 @@ TEST(DebugSession, WhenConvertingThreadIdsThenDeviceFunctionsAreCalled) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -606,7 +606,7 @@ TEST(DebugSessionTest, WhenConvertingThreadIDsForDeviceWithSingleSliceThenSubsli hwInfo.gtSystemInfo.SubSliceCount = 8; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ASSERT_NE(nullptr, sessionMock); @@ -642,7 +642,7 @@ TEST(DebugSessionTest, WhenConvertingThreadIDsForDeviceWithMultipleSlicesThenSub hwInfo.gtSystemInfo.SubSliceCount = 8; NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); ASSERT_NE(nullptr, sessionMock); diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp index 110eef9523..2f8d8cc5f4 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp @@ -159,7 +159,7 @@ TEST(DebugSessionLinuxi915Test, WhenConvertingThreadIDsForDeviceWithSingleSliceT neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); @@ -213,7 +213,7 @@ TEST(DebugSessionLinuxi915Test, WhenConvertingThreadIDsForDeviceWithMultipleSlic neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); @@ -264,7 +264,7 @@ TEST(DebugSessionLinuxi915Test, GivenDeviceWithSingleSliceWhenCallingAreRequeste neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); @@ -374,7 +374,7 @@ TEST(DebugSessionLinuxi915Test, GivenRootDebugSessionWhenCreateTileSessionCalled neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); struct DebugSession : public DebugSessionLinuxi915 { using DebugSessionLinuxi915::createTileSession; @@ -396,7 +396,7 @@ TEST(DebugSessionLinuxi915Test, GivenRootLinuxSessionWhenCallingTileSepcificFunc neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); @@ -413,7 +413,7 @@ TEST(DebugSessionLinuxi915Test, GivenContextStateSaveAreaBindInfoWhenGettingCSSA neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); @@ -973,7 +973,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenReadingEventThenResultNotReadyIsR zet_debug_config_t config = {}; config.pid = 0x1234; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto mockSession = new MockDebugSessionLinuxi915(config, &deviceImp, 10); mockSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; deviceImp.debugSession.reset(mockSession); diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/tile_debug_session_linux_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/tile_debug_session_linux_tests.cpp index 25d8f3e6d6..8939ba5713 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/tile_debug_session_linux_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/tile_debug_session_linux_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -37,7 +37,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenCallingFunctionsThe neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, nullptr); ASSERT_NE(nullptr, session); @@ -56,7 +56,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenCallingFunctionsThe NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; @@ -101,7 +101,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextState NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; @@ -126,7 +126,7 @@ TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextState NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp index 5b2a8492d7..dd6bbbdf20 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp @@ -2820,7 +2820,7 @@ TEST(DebugSessionLinuxXeTest, GivenRootDebugSessionWhenCreateTileSessionCalledTh auto mockDrm = new DrmMock(*neoDevice->executionEnvironment->rootDeviceEnvironments[0]); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); struct DebugSession : public DebugSessionLinuxXe { using DebugSessionLinuxXe::createTileSession; using DebugSessionLinuxXe::DebugSessionLinuxXe; diff --git a/level_zero/tools/test/unit_tests/sources/debug/test_debug_api.cpp b/level_zero/tools/test/unit_tests/sources/debug/test_debug_api.cpp index 72180f0e5b..4d1ebd601c 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/test_debug_api.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/test_debug_api.cpp @@ -132,7 +132,7 @@ TEST_F(DebugApiTest, givenSubDeviceWhenCallingDebugAttachThenErrorIsReturned) { config.pid = 0x1234; zet_debug_session_handle_t debugSession = nullptr; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.isSubdevice = true; auto result = zetDebugAttach(deviceImp.toHandle(), &config, &debugSession); @@ -189,7 +189,7 @@ TEST_F(DebugApiTest, givenTileAttachedDisabledAndSubDeviceWhenDebugAttachIsAvaia neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new OsInterfaceWithDebugAttach); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.isSubdevice = true; auto result = zetDeviceGetDebugProperties(deviceImp.toHandle(), &debugProperties); @@ -202,7 +202,7 @@ TEST_F(DebugApiTest, givenDeviceWithDebugSessionWhenDebugAttachIsCalledThenSessi zet_debug_config_t config = {}; config.pid = 0x1234; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.debugSession.reset(new DebugSessionMock(config, &deviceImp)); zet_debug_session_handle_t debugSession = nullptr; @@ -216,7 +216,7 @@ TEST_F(DebugApiTest, givenDeviceWithDebugSessionWhenDebugDetachIsCalledThenSucce zet_debug_config_t config = {}; config.pid = 0x1234; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.debugSession.reset(new DebugSessionMock(config, &deviceImp)); zet_debug_session_handle_t debugSession = deviceImp.debugSession->toHandle(); @@ -227,7 +227,7 @@ TEST_F(DebugApiTest, givenDeviceWithDebugSessionWhenDebugDetachIsCalledThenSucce } TEST_F(DebugApiTest, givenDeviceWithoutSessionWhenDebugDetachIsCalledThenSuccessIsReturned) { - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); zet_debug_session_handle_t debugSession = 0; auto result = zetDebugDetach(debugSession); @@ -240,7 +240,7 @@ TEST_F(DebugApiTest, WhenUnsupportedFunctionCalledThenErrorIsReturned) { zet_debug_config_t config = {}; config.pid = 0x1234; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.debugSession.reset(new DebugSessionMock(config, &deviceImp)); zet_debug_session_handle_t session = deviceImp.debugSession->toHandle(); @@ -485,7 +485,7 @@ TEST(DebugSessionTest, givenDebugSessionWhenConvertingToAndFromHandleCorrectHand config.pid = 0x1234; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); L0::DebugSession *session = debugSession.get(); @@ -501,7 +501,7 @@ TEST(DebugSessionTest, givenDebugSessionWhenGettingConnectedDeviceThenCorrectDev config.pid = 0x1234; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); L0::DebugSession *session = debugSession.get(); @@ -515,7 +515,7 @@ TEST(DebugSessionTest, givenDeviceWithDebugSessionWhenRemoveCalledThenSessionIsN config.pid = 0x1234; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(config, &deviceImp); L0::DebugSession *session = debugSession.get(); deviceImp.debugSession.reset(session); @@ -532,7 +532,7 @@ TEST(DebugSessionTest, givenTileAttachDisabledAndSubDeviceWhenCreatingSessionThe config.pid = 0x1234; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.isSubdevice = true; ze_result_t result = ZE_RESULT_ERROR_DEVICE_LOST; @@ -553,7 +553,7 @@ TEST(DebugSessionTest, givenTileAttachDisabledAndSubDeviceWhenDebugAttachCalledT neoDevice->incRefInternal(); auto neoSubdevice = std::unique_ptr(neoDevice->createSubDevice(0)); - auto deviceImp = std::make_unique(neoSubdevice.get(), neoSubdevice->getExecutionEnvironment()); + auto deviceImp = std::make_unique(neoSubdevice.get()); deviceImp->isSubdevice = true; ze_result_t result = ZE_RESULT_ERROR_DEVICE_LOST; @@ -574,7 +574,7 @@ TEST(DebugSessionTest, givenRootDeviceWhenCreatingSessionThenResultReturnedIsCor osInterface->debugAttachAvailable = false; neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(osInterface); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.isSubdevice = false; ze_result_t result = ZE_RESULT_ERROR_DEVICE_LOST; @@ -595,7 +595,7 @@ TEST_F(DebugApiTest, givenZeAffinityMaskAndEnabledDebugMessagesWhenDebugAttachCa zet_debug_config_t config = {}; config.pid = 0x1234; - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.debugSession.reset(new DebugSessionMock(config, &deviceImp)); testing::internal::CaptureStdout(); diff --git a/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp b/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp index c3dc580940..cd7826caa0 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/windows/test_debug_api_windows.cpp @@ -627,7 +627,7 @@ TEST_F(DebugApiWindowsTest, givenInvalidTopologyDebugAttachCalledThenUnsupported auto mockWddm = new WddmEuDebugInterfaceMock(*neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockWddm)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); ze_result_t result = ZE_RESULT_SUCCESS; VariableBackup mockCreateDebugSessionBackup(&L0::ult::createDebugSessionFunc, [](const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) -> DebugSession * { @@ -646,7 +646,7 @@ TEST_F(DebugApiWindowsTest, givenSubDeviceWhenDebugAttachCalledThenUnsupportedEr config.pid = 0x1234; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(NEO::defaultHwInfo.get(), 0)); - MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + MockDeviceImp deviceImp(neoDevice); deviceImp.isSubdevice = true; auto mockWddm = new WddmEuDebugInterfaceMock(*neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]); diff --git a/level_zero/tools/test/unit_tests/sources/debug/xe_hpc_core/pvc/test_debug_session_pvc.cpp b/level_zero/tools/test/unit_tests/sources/debug/xe_hpc_core/pvc/test_debug_session_pvc.cpp index d086264977..1a17a90a29 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/xe_hpc_core/pvc/test_debug_session_pvc.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/xe_hpc_core/pvc/test_debug_session_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -26,7 +26,7 @@ PVCTEST_F(PVCDebugSession, givenPVCRevId3WhenGettingPerThreadScratchOffsetThenPe hwInfo.platform.usRevId = 3; NEO::Device *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); - L0::ult::MockDeviceImp deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); + L0::ult::MockDeviceImp deviceImp(neoDevice); auto debugSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp); const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount);