From 7a2310163ef3fb61bfae75824627f35d8d82a71c Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Tue, 24 Mar 2020 11:42:54 +0100 Subject: [PATCH] Remove platformDevices [2/n] replace **platformDevices with *defaultHwInfo replace *platformDevices[0] with *defaultHwInfo Related-To: NEO-4499 Change-Id: If973ceb44ede2e940969f9c666f85d9a939fbff8 Signed-off-by: Mateusz Jablonski --- .../enqueue_kernel_aub_tests.cpp | 2 +- .../aub_tests/fixtures/aub_fixture.h | 2 +- .../command_queue/command_queue_tests.cpp | 4 +- .../command_queue/enqueue_kernel_1_tests.cpp | 6 +- .../command_queue/enqueue_kernel_2_tests.cpp | 2 +- .../aub_command_stream_receiver_2_tests.cpp | 2 +- .../command_stream/aub_file_stream_tests.cpp | 4 +- ...and_stream_receiver_flush_task_2_tests.cpp | 2 +- .../command_stream_receiver_hw_tests.inl | 6 +- .../command_stream_receiver_tests.cpp | 2 +- .../tbx_command_stream_tests.cpp | 4 +- .../unit_test/device/device_caps_tests.cpp | 60 +++++++++---------- opencl/test/unit_test/device/device_tests.cpp | 14 ++--- .../unit_test/device/sub_device_tests.cpp | 2 +- .../unit_test/fixtures/device_fixture.cpp | 4 +- .../fixtures/memory_allocator_fixture.h | 2 +- .../fixtures/templated_fixture_tests.cpp | 4 +- .../ult_command_stream_receiver_fixture.h | 2 +- .../gen12lp/hw_helper_tests_gen12lp.inl | 6 +- .../gen12lp/tgllp/kernel_tests_tgllp.cpp | 2 +- .../windows/gmm_callbacks_tests_gen12lp.cpp | 4 +- .../unit_test/gmm_helper/gmm_helper_tests.cpp | 4 +- .../unit_test/helpers/hw_helper_tests.cpp | 20 +++---- opencl/test/unit_test/kernel/kernel_tests.cpp | 6 +- ..._manager_allocate_in_device_pool_tests.inl | 6 +- .../memory_manager/memory_manager_tests.cpp | 32 +++++----- .../memory_manager/surface_tests.cpp | 2 +- opencl/test/unit_test/mocks/mock_aub_csr.h | 4 +- .../linux/drm_command_stream_tests.cpp | 8 +-- .../os_interface/linux/os_time_test.cpp | 6 +- .../windows/gl/gl_os_sharing_tests.cpp | 8 +-- .../windows/hw_info_config_win_tests.cpp | 2 +- .../windows/os_context_win_tests.cpp | 4 +- .../windows/os_interface_win_tests.cpp | 4 +- .../os_interface/windows/wddm20_tests.cpp | 8 +-- .../os_interface/windows/wddm23_tests.cpp | 6 +- .../os_interface/windows/wddm_fixture.h | 4 +- .../windows/wddm_memory_manager_tests.cpp | 16 ++--- .../windows/wddm_memory_manager_tests.h | 2 +- .../wddm_residency_controller_tests.cpp | 2 +- .../unit_test/platform/platform_tests.cpp | 6 +- .../unit_test/profiling/profiling_tests.cpp | 2 +- .../scheduler/scheduler_kernel_tests.cpp | 4 +- opencl/test/unit_test/ult_config_listener.cpp | 2 +- .../unit_test/gen11/test_preamble_gen11.cpp | 10 ++-- .../gen12lp/test_preamble_gen12lp.cpp | 2 +- .../unit_test/gen8/test_preamble_gen8.cpp | 10 ++-- .../unit_test/gen9/preamble_tests_gen9.cpp | 6 +- .../unit_test/gen9/skl/test_preamble_skl.cpp | 4 +- .../windows/wddm_preemption_tests.cpp | 2 +- .../unit_test/preamble/preamble_tests.cpp | 2 +- .../unit_test/preemption/preemption_tests.cpp | 4 +- 52 files changed, 167 insertions(+), 167 deletions(-) diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp index 796752c75e..26b25dca31 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp @@ -23,7 +23,7 @@ using namespace NEO; -extern const HardwareInfo **platformDevices; +extern const HardwareInfo *defaultHwInfo; struct TestParam { cl_uint globalWorkSizeX; diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h index 36b427336e..786fa862a4 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h @@ -28,7 +28,7 @@ namespace NEO { class AUBFixture : public CommandQueueHwFixture { public: void SetUp(const HardwareInfo *hardwareInfo) { - const HardwareInfo &hwInfo = hardwareInfo ? *hardwareInfo : *platformDevices[0]; + const HardwareInfo &hwInfo = hardwareInfo ? *hardwareInfo : *defaultHwInfo; uint32_t deviceIndex = 0; auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index 9c2064c282..0f607e9b74 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -212,7 +212,7 @@ TEST(CommandQueue, givenDeviceWhenCreatingCommandQueueThenPickCsrFromDefaultEngi } TEST(CommandQueue, givenDeviceNotSupportingBlitOperationsWhenQueueIsCreatedThenDontRegisterBcsCsr) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = false; auto mockDevice = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); MockCommandQueue cmdQ(nullptr, mockDevice.get(), 0); @@ -226,7 +226,7 @@ HWTEST_F(CommandQueueWithSubDevicesTest, givenDeviceWithSubDevicesSupportingBlit VariableBackup mockDeviceFlagBackup{&MockDevice::createSingleDevice, false}; DebugManager.flags.CreateMultipleSubDevices.set(2); DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.set(1); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; bool createBcsEngine = !hwInfo.capabilityTable.blitterOperationsSupported; hwInfo.capabilityTable.blitterOperationsSupported = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp index d1668bc569..7f29f843df 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp @@ -583,7 +583,7 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenEnqueueK HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtrWithL3FlushRequiredWhenEnqueueKernelIsCalledThenFlushIsCalledForReducedAddressSpacePlatforms) { std::unique_ptr device; std::unique_ptr cmdQ; - auto hwInfoToModify = *platformDevices[0]; + auto hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max36BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); @@ -607,7 +607,7 @@ HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtr HWTEST_F(EnqueueKernelTest, givenReducedAddressSpaceGraphicsAllocationForHostPtrWithL3FlushUnrequiredWhenEnqueueKernelIsCalledThenFlushIsNotForcedByGraphicsAllocation) { std::unique_ptr device; std::unique_ptr cmdQ; - auto hwInfoToModify = *platformDevices[0]; + auto hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max36BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); @@ -632,7 +632,7 @@ HWTEST_F(EnqueueKernelTest, givenFullAddressSpaceGraphicsAllocationWhenEnqueueKe HardwareInfo hwInfoToModify; std::unique_ptr device; std::unique_ptr cmdQ; - hwInfoToModify = *platformDevices[0]; + hwInfoToModify = *defaultHwInfo; hwInfoToModify.capabilityTable.gpuAddressSpace = MemoryConstants::max48BitAddress; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfoToModify)}); auto mockCsr = new MockCsrHw2(*device->executionEnvironment, device->getRootDeviceIndex()); diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp index af02129576..9cd025e0d0 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp @@ -331,7 +331,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueScratchSpaceTests, GivenKernelRequiringScratc auto *cmd = (MEDIA_VFE_STATE *)*itorCmd; auto *sba = (STATE_BASE_ADDRESS *)*itorCmdForStateBase; - const HardwareInfo &hwInfo = **platformDevices; + const HardwareInfo &hwInfo = *defaultHwInfo; uint32_t threadPerEU = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU; uint32_t maxNumberOfThreads = hwInfo.gtSystemInfo.EUCount * threadPerEU; diff --git a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp index ea418b0f29..1ec09c6a50 100644 --- a/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_command_stream_receiver_2_tests.cpp @@ -495,7 +495,7 @@ HWTEST_F(AubCommandStreamReceiverNoHostPtrTests, givenAubCommandStreamReceiverWh executionEnvironment->memoryManager.reset(memoryManager); std::unique_ptr> aubCsr(new AUBCommandStreamReceiverHw("", true, *executionEnvironment, 0)); - auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(**platformDevices), 0, + auto osContext = memoryManager->createAndRegisterOsContext(aubCsr.get(), getChosenEngineType(*defaultHwInfo), 0, PreemptionMode::Disabled, false, false, false); aubCsr->setupContext(*osContext); diff --git a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp index 630249a513..80d18aa285 100644 --- a/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/aub_file_stream_tests.cpp @@ -991,10 +991,10 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenCreateFullFilePath DebugManagerStateRestore stateRestore; DebugManager.flags.CreateMultipleSubDevices.set(1); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*platformDevices[0], "aubfile"); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); EXPECT_EQ(std::string::npos, fullName.find("tx")); DebugManager.flags.CreateMultipleSubDevices.set(2); - fullName = AUBCommandStreamReceiver::createFullFilePath(*platformDevices[0], "aubfile"); + fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); EXPECT_NE(std::string::npos, fullName.find("2tx")); } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 53f591b6d4..6a55d48c7f 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -374,7 +374,7 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, GivenKernelWithSlmWhenPreviousSLML auto &commandStreamCSR = commandStreamReceiver->getCS(); - uint32_t L3Config = PreambleHelper::getL3Config(*platformDevices[0], true); + uint32_t L3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); // Mark Pramble as sent, override L3Config to SLM config commandStreamReceiver->isPreambleSent = true; diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl index ebdaad8e32..68575e2139 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.inl @@ -63,7 +63,7 @@ void CommandStreamReceiverHwTest::givenKernelWithSlmWhenPreviousNOSLM auto cmdPC = genCmdCast(*itorCmd); ASSERT_NE(nullptr, cmdPC); - uint32_t L3Config = PreambleHelper::getL3Config(*platformDevices[0], true); + uint32_t L3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); EXPECT_EQ(L3Config, static_cast(cmdMILoad->getDataDword())); } @@ -83,7 +83,7 @@ void CommandStreamReceiverHwTest::givenBlockedKernelWithSlmWhenPrevio auto &commandStreamCSR = commandStreamReceiver->getCS(); - uint32_t L3Config = PreambleHelper::getL3Config(*platformDevices[0], false); + uint32_t L3Config = PreambleHelper::getL3Config(*defaultHwInfo, false); // Mark Pramble as sent, override L3Config to SLM config commandStreamReceiver->isPreambleSent = true; @@ -110,6 +110,6 @@ void CommandStreamReceiverHwTest::givenBlockedKernelWithSlmWhenPrevio auto cmdMILoad = genCmdCast(*itorCmd); ASSERT_NE(nullptr, cmdMILoad); - L3Config = PreambleHelper::getL3Config(*platformDevices[0], true); + L3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); EXPECT_EQ(L3Config, static_cast(cmdMILoad->getDataDword())); } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 8be9792caa..6ecaa3e70f 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -489,7 +489,7 @@ struct CreateAllocationForHostSurfaceTest : public ::testing::Test { device.reset(MockDevice::create(executionEnvironment, 0u)); commandStreamReceiver = &device->getGpgpuCommandStreamReceiver(); } - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; ExecutionEnvironment *executionEnvironment = nullptr; GMockMemoryManager *gmockMemoryManager = nullptr; std::unique_ptr device; diff --git a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp index 3f35ac6e54..bed7ee8260 100644 --- a/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp +++ b/opencl/test/unit_test/command_stream/tbx_command_stream_tests.cpp @@ -361,7 +361,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledTh } HWTEST_F(TbxCommandStreamTests, givenNoDbgDeviceIdFlagWhenTbxCsrIsCreatedThenUseDefaultDeviceId) { - const HardwareInfo &hwInfo = *platformDevices[0]; + const HardwareInfo &hwInfo = *defaultHwInfo; TbxCommandStreamReceiverHw *tbxCsr = reinterpret_cast *>(pCommandStreamReceiver); EXPECT_EQ(hwInfo.capabilityTable.aubDeviceId, tbxCsr->aubDeviceId); } @@ -590,7 +590,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenCreatedWithAubDumpThenFileNameIsE auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); setMockAubCenter(*rootDeviceEnvironment, CommandStreamReceiverType::CSR_TBX); - auto fullName = AUBCommandStreamReceiver::createFullFilePath(*platformDevices[0], "aubfile"); + auto fullName = AUBCommandStreamReceiver::createFullFilePath(*defaultHwInfo, "aubfile"); std::unique_ptr> tbxCsr(reinterpret_cast *>(TbxCommandStreamReceiver::create("aubfile", true, executionEnvironment, 0))); EXPECT_STREQ(fullName.c_str(), rootDeviceEnvironment->aubFileNameReceived.c_str()); diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 07d3ed8195..bf11f6dd36 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -362,7 +362,7 @@ TEST_F(DeviceGetCapsTest, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjus HardwareCapabilities hwCaps = {0}; auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily); - hwHelper.setupHardwareCapabilities(&hwCaps, *platformDevices[0]); + hwHelper.setupHardwareCapabilities(&hwCaps, *defaultHwInfo); uint64_t expectedSize = std::max((caps.globalMemSize / 2), static_cast(128ULL * MemoryConstants::megaByte)); expectedSize = std::min(expectedSize, hwCaps.maxMemAllocSize); @@ -458,7 +458,7 @@ TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReport TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsClIntelSpirvMediaBlockIoExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(21); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -468,7 +468,7 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsC TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsClIntelSpirvMediaBlockIoExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(21); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -476,7 +476,7 @@ TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotRe } TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsClKhr3dImageWritesExtensions) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -485,7 +485,7 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsC } TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsClKhr3dImageWritesExtensions) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -533,7 +533,7 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsP DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnablePackedYuv.set(true); DebugManager.flags.EnableNV12.set(true); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -545,7 +545,7 @@ TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotRe DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnablePackedYuv.set(true); DebugManager.flags.EnableNV12.set(true); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -576,7 +576,7 @@ TEST_F(DeviceGetCapsTest, givenEnablePackedYuvsetToFalseWhenCapsAreCreatedThenDe TEST_F(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelVme.set(1); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -591,7 +591,7 @@ TEST_F(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceSupportsVmeWhenCapsAre TEST_F(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceReportsVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelVme.set(1); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -606,7 +606,7 @@ TEST_F(DeviceGetCapsTest, givenEnableVmeSetToTrueAndDeviceDoesNotSupportVmeWhenC TEST_F(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelVme.set(0); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -621,7 +621,7 @@ TEST_F(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceDoesNotSupportVmeWhen TEST_F(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelVme.set(0); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -636,7 +636,7 @@ TEST_F(DeviceGetCapsTest, givenEnableVmeSetToFalseAndDeviceSupportsVmeWhenCapsAr TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceReportsAdvancedVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelAdvancedVme.set(1); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -648,7 +648,7 @@ TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceSupportsVmeWhe } TEST_F(DeviceGetCapsTest, givenDeviceCapsSupportFor64BitAtomicsFollowsHardwareCapabilities) { - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -664,7 +664,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceCapsSupportFor64BitAtomicsFollowsHardwareCa TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceReportAdvancedVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelAdvancedVme.set(1); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -678,7 +678,7 @@ TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToTrueAndDeviceDoesNotSupport TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceDoesNotSupportVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelAdvancedVme.set(0); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -692,7 +692,7 @@ TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceDoesNotSuppor TEST_F(DeviceGetCapsTest, givenEnableAdvancedVmeSetToFalseAndDeviceSupportsVmeWhenCapsAreCreatedThenDeviceDoesNotReportAdvancedVmeExtensionAndBuiltins) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.EnableIntelAdvancedVme.set(0); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsVme = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -763,7 +763,7 @@ TEST_F(DeviceGetCapsTest, givenAtleastOCL2DeviceThenExposesMipMapAndUnifiedMemor TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsMinMapExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(20); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -774,7 +774,7 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsM TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsMinMapExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(20); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); @@ -797,7 +797,7 @@ TEST_F(DeviceGetCapsTest, givenOCL12DeviceThenDoesNotExposesMipMapAndUnifiedMemo TEST_F(DeviceGetCapsTest, givenSupporteImagesWhenCreateExtentionsListThenDeviceReportsImagesExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(20); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto extensions = device->getDeviceInfo().deviceExtensions; @@ -810,7 +810,7 @@ TEST_F(DeviceGetCapsTest, givenSupporteImagesWhenCreateExtentionsListThenDeviceR TEST_F(DeviceGetCapsTest, givenNotSupporteImagesWhenCreateExtentionsListThenDeviceNotReportsImagesExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(20); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto extensions = device->getDeviceInfo().deviceExtensions; @@ -821,7 +821,7 @@ TEST_F(DeviceGetCapsTest, givenNotSupporteImagesWhenCreateExtentionsListThenDevi } TEST_F(DeviceGetCapsTest, givenDeviceThatDoesntHaveFp64ThenExtensionIsNotReported) { - HardwareInfo nonFp64Device = *platformDevices[0]; + HardwareInfo nonFp64Device = *defaultHwInfo; nonFp64Device.capabilityTable.ftrSupportsFP64 = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&nonFp64Device)); @@ -836,7 +836,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceWhenGettingHostUnifiedMemoryCapThenItDepend const auto &caps = device->getDeviceInfo(); auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily); - auto localMemoryEnabled = hwHelper.isLocalMemoryEnabled(*platformDevices[0]); + auto localMemoryEnabled = hwHelper.isLocalMemoryEnabled(*defaultHwInfo); EXPECT_EQ((localMemoryEnabled == false), caps.hostUnifiedMemory); } @@ -844,7 +844,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceWhenGettingHostUnifiedMemoryCapThenItDepend TEST(DeviceGetCaps, givenDeviceThatDoesntHaveFp64WhenDbgFlagEnablesFp64ThenReportFp64Flags) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.OverrideDefaultFP64Settings.set(1); - HardwareInfo nonFp64Device = *platformDevices[0]; + HardwareInfo nonFp64Device = *defaultHwInfo; nonFp64Device.capabilityTable.ftrSupportsFP64 = false; nonFp64Device.capabilityTable.ftrSupports64BitMath = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&nonFp64Device)); @@ -861,7 +861,7 @@ TEST(DeviceGetCaps, givenDeviceThatDoesntHaveFp64WhenDbgFlagEnablesFp64ThenRepor TEST(DeviceGetCaps, givenDeviceThatDoesHaveFp64WhenDbgFlagDisablesFp64ThenDontReportFp64Flags) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.OverrideDefaultFP64Settings.set(0); - HardwareInfo fp64Device = *platformDevices[0]; + HardwareInfo fp64Device = *defaultHwInfo; fp64Device.capabilityTable.ftrSupportsFP64 = true; fp64Device.capabilityTable.ftrSupports64BitMath = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&fp64Device)); @@ -898,7 +898,7 @@ TEST(DeviceGetCaps, givenOclVersion21WhenCapsAreCreatedThenDeviceReportsSpirvAsS } TEST(DeviceGetCaps, givenDisabledFtrPooledEuWhenCalculatingMaxEuPerSSThenIgnoreEuCountPerPoolMin) { - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; FeatureTable &mySkuTable = myHwInfo.featureTable; @@ -916,7 +916,7 @@ TEST(DeviceGetCaps, givenDisabledFtrPooledEuWhenCalculatingMaxEuPerSSThenIgnoreE } HWTEST_F(DeviceGetCapsTest, givenEnabledFtrPooledEuWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin) { - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; FeatureTable &mySkuTable = myHwInfo.featureTable; @@ -936,7 +936,7 @@ TEST(DeviceGetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCap DebugManagerStateRestore dbgRestorer; DebugManager.flags.UseMaxSimdSizeToDeduceMaxWorkgroupSize.set(true); - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; mySysInfo.EUCount = 24; @@ -952,7 +952,7 @@ TEST(DeviceGetCaps, givenDebugFlagToUseCertainWorkgroupSizeWhenDeviceIsCreatedIt DebugManagerStateRestore dbgRestorer; DebugManager.flags.OverrideMaxWorkgroupSize.set(16u); - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; mySysInfo.EUCount = 24; @@ -964,7 +964,7 @@ TEST(DeviceGetCaps, givenDebugFlagToUseCertainWorkgroupSizeWhenDeviceIsCreatedIt } HWTEST_F(DeviceGetCapsTest, givenDeviceThatHasHighNumberOfExecutionUnitsWhenMaxWorkgroupSizeIsComputedItIsLimitedTo1024) { - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; auto &hwHelper = HwHelper::get(myHwInfo.platform.eRenderCoreFamily); @@ -1091,7 +1091,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceWithNullSourceLevelDebuggerWhenCapsAreIniti } TEST(Device_UseCaps, givenCapabilityTableWhenDeviceInitializeCapsThenVmeVersionsAreSetProperly) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; cl_uint expectedVmeVersion = CL_ME_VERSION_ADVANCED_VER_2_INTEL; cl_uint expectedVmeAvcVersion = CL_AVC_ME_VERSION_1_INTEL; diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 7d1aa15d0d..b941ce7aca 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -55,7 +55,7 @@ TEST_F(DeviceTest, givenDeviceWhenEngineIsCreatedThenSetInitialValueForTag) { } TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenRetrunIt) { - auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0]); + auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo); for (uint32_t i = 0; i < engines.size(); i++) { bool lowPriority = (HwHelper::lowPriorityGpgpuEngineIndex == i); auto &deviceEngine = pDevice->getEngine(engines[i], lowPriority); @@ -69,7 +69,7 @@ TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenRetrunIt) { TEST_F(DeviceTest, givenDebugVariableToAlwaysChooseEngineZeroWhenNotExistingEngineSelectedThenIndexZeroEngineIsReturned) { DebugManagerStateRestore restore; DebugManager.flags.OverrideInvalidEngineWithDefault.set(true); - auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0]); + auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo); auto &deviceEngine = pDevice->getEngine(engines[0], false); auto ¬ExistingEngine = pDevice->getEngine(aub_stream::ENGINE_VCS, false); EXPECT_EQ(¬ExistingEngine, &deviceEngine); @@ -108,7 +108,7 @@ TEST_F(DeviceTest, WhenRetainingThenReferenceIsOneAndApiIsUsed) { } HWTEST_F(DeviceTest, WhenDeviceIsCreatedThenActualEngineTypeIsSameAsDefault) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; if (hwInfo.capabilityTable.defaultEngineType == aub_stream::EngineType::ENGINE_CCS) { hwInfo.featureTable.ftrCCSNode = true; } @@ -195,7 +195,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachOsContextHasU for (auto i = 0u; i < numDevices; i++) { executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices); } - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; const auto &numGpgpuEngines = static_cast(HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo).size()); auto device1 = std::unique_ptr(Device::create(executionEnvironment, 0u)); @@ -239,7 +239,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) { executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(*platformDevices); } - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; const auto &numGpgpuEngines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo).size(); auto device1 = std::unique_ptr(Device::create(executionEnvironment, 0u)); auto device2 = std::unique_ptr(Device::create(executionEnvironment, 1u)); @@ -266,7 +266,7 @@ HWTEST_F(DeviceTest, givenDeviceWhenAskingForDefaultEngineThenReturnValidValue) } TEST(DeviceCreation, givenFtrSimulationModeFlagTrueWhenNoOtherSimulationFlagsArePresentThenIsSimulationReturnsTrue) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrSimulationMode = true; bool simulationFromDeviceId = hwInfo.capabilityTable.isSimulation(hwInfo.platform.usDeviceID); @@ -284,7 +284,7 @@ TEST(DeviceCreation, givenDeviceWhenCheckingEnginesCountThenNumberGreaterThanZer using DeviceHwTest = ::testing::Test; HWTEST_F(DeviceHwTest, givenHwHelperInputWhenInitializingCsrThenCreatePageTableManagerIfNeeded) { - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.capabilityTable.ftrRenderCompressedBuffers = false; localHwInfo.capabilityTable.ftrRenderCompressedImages = false; diff --git a/opencl/test/unit_test/device/sub_device_tests.cpp b/opencl/test/unit_test/device/sub_device_tests.cpp index 2caebc8977..2ddc11ccd6 100644 --- a/opencl/test/unit_test/device/sub_device_tests.cpp +++ b/opencl/test/unit_test/device/sub_device_tests.cpp @@ -171,7 +171,7 @@ TEST(SubDevicesTest, givenSubDevicesWhenGettingDeviceByIdZeroThenGetThisSubDevic } TEST(RootDevicesTest, givenRootDeviceWithoutSubdevicesWhenCreateEnginesThenDeviceCreatesCorrectNumberOfEngines) { - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; auto &gpgpuEngines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo); auto executionEnvironment = new MockExecutionEnvironment; diff --git a/opencl/test/unit_test/fixtures/device_fixture.cpp b/opencl/test/unit_test/fixtures/device_fixture.cpp index ad394fb04b..ba848ced3a 100644 --- a/opencl/test/unit_test/fixtures/device_fixture.cpp +++ b/opencl/test/unit_test/fixtures/device_fixture.cpp @@ -11,7 +11,7 @@ namespace NEO { void DeviceFixture::SetUp() { - hardwareInfo = *platformDevices[0]; + hardwareInfo = *defaultHwInfo; SetUpImpl(&hardwareInfo); } @@ -33,7 +33,7 @@ void DeviceFixture::TearDown() { } MockDevice *DeviceFixture::createWithUsDeviceId(unsigned short usDeviceId) { - hardwareInfo = *platformDevices[0]; + hardwareInfo = *defaultHwInfo; hardwareInfo.platform.usDeviceID = usDeviceId; return MockDevice::createWithNewExecutionEnvironment(&hardwareInfo); } diff --git a/opencl/test/unit_test/fixtures/memory_allocator_fixture.h b/opencl/test/unit_test/fixtures/memory_allocator_fixture.h index 431322d9f2..232a44ee21 100644 --- a/opencl/test/unit_test/fixtures/memory_allocator_fixture.h +++ b/opencl/test/unit_test/fixtures/memory_allocator_fixture.h @@ -32,7 +32,7 @@ class MemoryAllocatorFixture : public MemoryManagementFixture { auto &hwInfo = device->getHardwareInfo(); auto engineType = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0]; auto osContext = memoryManager->createAndRegisterOsContext(csr, engineType, 1, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); csr->setupContext(*osContext); } diff --git a/opencl/test/unit_test/fixtures/templated_fixture_tests.cpp b/opencl/test/unit_test/fixtures/templated_fixture_tests.cpp index 8cd3a372b5..e5f901afa9 100644 --- a/opencl/test/unit_test/fixtures/templated_fixture_tests.cpp +++ b/opencl/test/unit_test/fixtures/templated_fixture_tests.cpp @@ -78,7 +78,7 @@ HWTEST_TEMPLATED_F(DerivedTemplatedFixtureTests, whenExecutingTemplatedTestThenC struct TemplatedFixtureBaseTests : public ::testing::Test { template void SetUpT() { - capturedPipeControlWaRequiredInSetUp = HardwareCommandsHelper::isPipeControlWArequired(**platformDevices); + capturedPipeControlWaRequiredInSetUp = HardwareCommandsHelper::isPipeControlWArequired(*defaultHwInfo); } template @@ -88,7 +88,7 @@ struct TemplatedFixtureBaseTests : public ::testing::Test { }; HWTEST_TEMPLATED_F(TemplatedFixtureBaseTests, whenExecutingTemplatedSetupThenTemplateTargetsCorrectPlatform) { - bool capturedPipeControlWaRequiredInTestBody = HardwareCommandsHelper::isPipeControlWArequired(**platformDevices); + bool capturedPipeControlWaRequiredInTestBody = HardwareCommandsHelper::isPipeControlWArequired(*defaultHwInfo); EXPECT_EQ(capturedPipeControlWaRequiredInTestBody, capturedPipeControlWaRequiredInSetUp); } diff --git a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h index 2e79e8bd4c..190ac7c48a 100644 --- a/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h +++ b/opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h @@ -114,7 +114,7 @@ struct UltCommandStreamReceiverTest slmUsed = true; } - uint32_t L3Config = PreambleHelper::getL3Config(*platformDevices[0], slmUsed); + uint32_t L3Config = PreambleHelper::getL3Config(*defaultHwInfo, slmUsed); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver(); commandStreamReceiver.isPreambleSent = true; diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index 465dc2f580..b521f2fb44 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -108,7 +108,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenDifferentSizesOfAllocationWhenCheckingCo } GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenReturnThreeRcsEngines) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = false; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; @@ -122,7 +122,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenR } GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenReturnTwoRcsAndCcsEngines) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = true; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; @@ -137,7 +137,7 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenRetu } GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetAndDefaultRcsWhenGetGpgpuEnginesThenReturnThreeRcsAndCcsEngines) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrCCSNode = true; hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS; diff --git a/opencl/test/unit_test/gen12lp/tgllp/kernel_tests_tgllp.cpp b/opencl/test/unit_test/gen12lp/tgllp/kernel_tests_tgllp.cpp index 09a6ed7d6f..186f6ffb43 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/kernel_tests_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/kernel_tests_tgllp.cpp @@ -20,7 +20,7 @@ TGLLPTEST_F(KernelTgllpTests, GivenUseOffsetToSkipSetFFIDGPWorkaroundActiveWhenS const uint64_t additionalOffsetDueToFfid = 0x1234; SPatchThreadPayload threadPayload{}; threadPayload.OffsetToSkipSetFFIDGP = additionalOffsetDueToFfid; - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; unsigned short steppings[] = {REVISION_A0, REVISION_A0 + 1}; for (auto stepping : steppings) { diff --git a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp index 5504373256..fa980e7955 100644 --- a/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp +++ b/opencl/test/unit_test/gen12lp/windows/gmm_callbacks_tests_gen12lp.cpp @@ -77,7 +77,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenWddmCsrWhenWriteL3CalledThenWriteTw GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsEnabledhenWriteL3CalledThenSetRemapBit) { typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; - HardwareInfo localHwInfo = **platformDevices; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.featureTable.ftrCCSNode = true; ExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1u); @@ -105,7 +105,7 @@ GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsEnabledhenWriteL3CalledThenSetRe GEN12LPTEST_F(Gen12LpGmmCallbacksTests, givenCcsDisabledhenWriteL3CalledThenSetRemapBitToTrue) { typedef typename FamilyType::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; - HardwareInfo localHwInfo = **platformDevices; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.featureTable.ftrCCSNode = false; ExecutionEnvironment executionEnvironment; executionEnvironment.prepareRootDeviceEnvironments(1u); diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 7a860da7c5..7ee72b5589 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -346,7 +346,7 @@ TEST_F(GmmTests, givenNonZeroRowPitchWhenQueryImgFromBufferParamsThenUseUserValu } TEST_F(GmmTests, WhenCanonizingThenCorrectAddressIsReturned) { - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; // 48 bit - canonize to 48 bit hwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(48); // 0x0000FFFFFFFFFFFF; @@ -369,7 +369,7 @@ TEST_F(GmmTests, WhenCanonizingThenCorrectAddressIsReturned) { } TEST_F(GmmTests, WhenDecanonizingThenCorrectAddressIsReturned) { - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; // 48 bit - decanonize to 48 bit hwInfo.capabilityTable.gpuAddressSpace = maxNBitValue(48); //0x0000FFFFFFFFFFFF; diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index fd62303c94..0a8ef0731b 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -34,7 +34,7 @@ using namespace NEO; TEST(HwHelperSimpleTest, givenDebugVariableWhenAskingForRenderCompressionThenReturnCorrectValue) { DebugManagerStateRestore restore; - HardwareInfo localHwInfo = **platformDevices; + HardwareInfo localHwInfo = *defaultHwInfo; // debug variable not set localHwInfo.capabilityTable.ftrRenderCompressedBuffers = false; @@ -201,7 +201,7 @@ HWTEST_F(PipeControlHelperTests, givenPostSyncWriteTimestampModeWhenHelperIsUsed expectedPipeControl.setPostSyncOperation(PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP); expectedPipeControl.setAddress(static_cast(address & 0x0000FFFFFFFFULL)); expectedPipeControl.setAddressHigh(static_cast(address >> 32)); - HardwareInfo hardwareInfo = *platformDevices[0]; + HardwareInfo hardwareInfo = *defaultHwInfo; auto pipeControl = MemorySynchronizationCommands::obtainPipeControlAndProgramPostSyncOperation( stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_TIMESTAMP, address, immediateData, false, hardwareInfo); @@ -227,7 +227,7 @@ HWTEST_F(PipeControlHelperTests, givenPostSyncWriteImmediateDataModeWhenHelperIs expectedPipeControl.setAddress(static_cast(address & 0x0000FFFFFFFFULL)); expectedPipeControl.setAddressHigh(static_cast(address >> 32)); expectedPipeControl.setImmediateData(immediateData); - HardwareInfo hardwareInfo = *platformDevices[0]; + HardwareInfo hardwareInfo = *defaultHwInfo; auto pipeControl = MemorySynchronizationCommands::obtainPipeControlAndProgramPostSyncOperation( stream, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, address, immediateData, false, hardwareInfo); @@ -584,10 +584,10 @@ HWTEST_F(HwHelperTest, DISABLED_profilingCreationOfRenderSurfaceStateVsMemcpyOfC HWTEST_F(HwHelperTest, testIfL3ConfigProgrammable) { bool PreambleHelperL3Config; bool isL3Programmable; - const HardwareInfo &hwInfo = **platformDevices; + const HardwareInfo &hwInfo = *defaultHwInfo; PreambleHelperL3Config = - PreambleHelper::isL3Configurable(**platformDevices); + PreambleHelper::isL3Configurable(*defaultHwInfo); isL3Programmable = HwHelperHw::get().isL3Configurable(hwInfo); @@ -598,7 +598,7 @@ TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsEnableWhenPlatformDoesNo DebugManagerStateRestore restore; DebugManager.flags.EnableCacheFlushAfterWalker.set(1); - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.capabilityTable.supportCacheFlushAfterWalker = false; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); @@ -609,7 +609,7 @@ TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsDisableWhenPlatformSuppo DebugManagerStateRestore restore; DebugManager.flags.EnableCacheFlushAfterWalker.set(0); - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.capabilityTable.supportCacheFlushAfterWalker = true; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); @@ -620,7 +620,7 @@ TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsReadPlatformSettingWhenP DebugManagerStateRestore restore; DebugManager.flags.EnableCacheFlushAfterWalker.set(-1); - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.capabilityTable.supportCacheFlushAfterWalker = false; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); @@ -631,7 +631,7 @@ TEST(HwHelperCacheFlushTest, givenEnableCacheFlushFlagIsReadPlatformSettingWhenP DebugManagerStateRestore restore; DebugManager.flags.EnableCacheFlushAfterWalker.set(-1); - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; localHwInfo.capabilityTable.supportCacheFlushAfterWalker = true; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); @@ -693,7 +693,7 @@ HWTEST_F(HwHelperTest, givenMultiDispatchInfoWhenAskingForAuxTranslationThenChec MockBuffer buffer; MemObjsForAuxTranslation memObjects; MultiDispatchInfo multiDispatchInfo; - HardwareInfo hwInfo = **platformDevices; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = true; DebugManager.flags.ForceAuxTranslationMode.set(static_cast(AuxTranslationMode::Blit)); diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index a3fd3e89c1..6c6e7c353d 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -2639,7 +2639,7 @@ TEST(KernelTest, givenKernelWhenDebugFlagToUseMaxSimdForCalculationsIsUsedThenMa DebugManagerStateRestore dbgStateRestore; DebugManager.flags.UseMaxSimdSizeToDeduceMaxWorkgroupSize.set(true); - HardwareInfo myHwInfo = *platformDevices[0]; + HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; mySysInfo.EUCount = 24; @@ -2726,7 +2726,7 @@ TEST(KernelTest, givenDebugVariableSetWhenKernelHasStatefulBufferAccessThenMarkK DebugManagerStateRestore restore; DebugManager.flags.RenderCompressedBuffersEnabled.set(1); - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); auto context = clUniquePtr(new MockContext(device.get())); @@ -2749,7 +2749,7 @@ TEST(KernelTest, givenDebugVariableSetWhenKernelHasStatefulBufferAccessThenMarkK } TEST(KernelTest, givenKernelWithPairArgumentWhenItIsInitializedThenPatchImmediateIsUsedAsArgHandler) { - HardwareInfo localHwInfo = *platformDevices[0]; + HardwareInfo localHwInfo = *defaultHwInfo; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&localHwInfo)); auto context = clUniquePtr(new MockContext(device.get())); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl index c2b3926da4..803ffb022d 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl +++ b/opencl/test/unit_test/memory_manager/memory_manager_allocate_in_device_pool_tests.inl @@ -49,7 +49,7 @@ TEST(MemoryManagerTest, givenAllowed32BitAndFroce32BitWhenGraphicsAllocationInDe } TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledThenAllocateFlagIsCorrectlySet) { - HardwareInfo hwInfo(*platformDevices[0]); + HardwareInfo hwInfo(*defaultHwInfo); auto allocationProperties = MemoryPropertiesParser::getAllocationProperties(0, {}, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo); EXPECT_TRUE(allocationProperties.flags.allocateMemory); @@ -59,7 +59,7 @@ TEST(AllocationFlagsTest, givenAllocateMemoryFlagWhenGetAllocationFlagsIsCalledT TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCalledThenUncacheableFlagIsCorrectlySet) { cl_mem_flags_intel flagsIntel = CL_MEM_LOCALLY_UNCACHED_RESOURCE; - HardwareInfo hwInfo(*platformDevices[0]); + HardwareInfo hwInfo(*defaultHwInfo); MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(0, flagsIntel, 0); auto allocationFlags = MemoryPropertiesParser::getAllocationProperties(0, memoryProperties, false, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo); EXPECT_TRUE(allocationFlags.flags.uncacheable); @@ -73,7 +73,7 @@ TEST(UncacheableFlagsTest, givenUncachedResourceFlagWhenGetAllocationFlagsIsCall TEST(AllocationFlagsTest, givenReadOnlyResourceFlagWhenGetAllocationFlagsIsCalledThenFlushL3FlagsAreCorrectlySet) { cl_mem_flags flags = CL_MEM_READ_ONLY; MemoryPropertiesFlags memoryProperties = MemoryPropertiesFlagsParser::createMemoryPropertiesFlags(flags, 0, 0); - HardwareInfo hwInfo(*platformDevices[0]); + HardwareInfo hwInfo(*defaultHwInfo); auto allocationFlags = MemoryPropertiesParser::getAllocationProperties(0, memoryProperties, true, 0, GraphicsAllocation::AllocationType::BUFFER, false, hwInfo); diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 400c48a563..095469db8a 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -201,8 +201,8 @@ TEST_F(MemoryAllocatorTest, allocateGraphics) { unsigned int alignment = 4096; memoryManager->createAndRegisterOsContext(csr, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); @@ -1412,8 +1412,8 @@ TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsCompletedWhenche TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsNotCompletedWhencheckGpuUsageAndDestroyGraphicsAllocationsIsCalledThenItIsAddedToTemporaryAllocationList) { memoryManager->createAndRegisterOsContext(csr.get(), - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); auto usedAllocationAndNotGpuCompleted = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); @@ -1664,8 +1664,8 @@ TEST(ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCo executionEnvironment.memoryManager.reset(memoryManager); std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); memoryManager->createAndRegisterOsContext(csr.get(), - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); EXPECT_EQ(1u, memoryManager->getRegisteredEnginesCount()); EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount()); @@ -1693,7 +1693,7 @@ TEST(ResidencyDataTest, givenDeviceBitfieldWhenCreatingOsContextThenSetValidValu DeviceBitfield deviceBitfield = 0b11; PreemptionMode preemptionMode = PreemptionMode::MidThread; memoryManager->createAndRegisterOsContext(csr.get(), - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], deviceBitfield, preemptionMode, false, false, false); EXPECT_EQ(2u, memoryManager->registeredEngines[0].osContext->getNumSupportedDevices()); @@ -1708,12 +1708,12 @@ TEST(ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegisteredFromHigherToLower std::unique_ptr csr(createCommandStream(executionEnvironment, 0u)); std::unique_ptr csr1(createCommandStream(executionEnvironment, 1u)); memoryManager->createAndRegisterOsContext(csr.get(), - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[1], - 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[1], + 1, PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); EXPECT_EQ(2u, memoryManager->getRegisteredEnginesCount()); EXPECT_EQ(1, memoryManager->registeredEngines[0].osContext->getRefInternalCount()); @@ -1721,7 +1721,7 @@ TEST(ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegisteredFromHigherToLower } TEST(ResidencyDataTest, givenGpgpuEnginesWhenAskedForMaxOsContextCountThenValueIsGreaterOrEqual) { - auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0]); + auto &engines = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo); EXPECT_TRUE(MemoryManager::maxOsContextCount >= engines.size()); } @@ -1733,11 +1733,11 @@ TEST(ResidencyDataTest, givenResidencyDataWhenUpdateCompletionDataIsCalledThenIt MockResidencyData residency; MockOsContext osContext(0u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); MockOsContext osContext2(1u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[1], - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[1], + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); auto lastFenceValue = 45llu; auto lastFenceValue2 = 23llu; diff --git a/opencl/test/unit_test/memory_manager/surface_tests.cpp b/opencl/test/unit_test/memory_manager/surface_tests.cpp index cd088638b7..124cd1b501 100644 --- a/opencl/test/unit_test/memory_manager/surface_tests.cpp +++ b/opencl/test/unit_test/memory_manager/surface_tests.cpp @@ -65,7 +65,7 @@ HWTEST_TYPED_TEST(SurfaceTest, GivenSurfaceWhenInterfaceIsUsedThenSurfaceBehaves ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment(); executionEnvironment->initializeMemoryManager(); auto csr = std::make_unique>(execStamp, *executionEnvironment, 0); - auto hwInfo = *platformDevices[0]; + auto hwInfo = *defaultHwInfo; auto engine = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo)[0]; auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(csr.get(), engine, 1, PreemptionHelper::getDefaultPreemptionMode(hwInfo), diff --git a/opencl/test/unit_test/mocks/mock_aub_csr.h b/opencl/test/unit_test/mocks/mock_aub_csr.h index be0df96945..1c673e737a 100644 --- a/opencl/test/unit_test/mocks/mock_aub_csr.h +++ b/opencl/test/unit_test/mocks/mock_aub_csr.h @@ -192,8 +192,8 @@ std::unique_ptr getEnvironment(bool createTagAllocation } auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver.get(), - getChosenEngineType(*platformDevices[0]), 1, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + getChosenEngineType(*defaultHwInfo), 1, + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); commandStreamReceiver->setupContext(*osContext); diff --git a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp index 8407f78e34..bdd6eeb4b8 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_command_stream_tests.cpp @@ -213,8 +213,8 @@ HWTEST_TEMPLATED_F(DrmCommandStreamTest, givenDrmContextIdWhenFlushingThenSetIdT .RetiresOnSaturation(); osContext = std::make_unique(*mock, 1, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); csr->setupContext(*osContext); @@ -644,7 +644,7 @@ class DrmCommandStreamBatchingTests : public DrmCommandStreamEnhancedTest { template void SetUpT() { DrmCommandStreamEnhancedTest::SetUpT(); - if (PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]) == PreemptionMode::MidThread) { + if (PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo) == PreemptionMode::MidThread) { tmpAllocation = GlobalMockSipProgram::sipProgram->getAllocation(); GlobalMockSipProgram::sipProgram->resetAllocation(device->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize})); } @@ -654,7 +654,7 @@ class DrmCommandStreamBatchingTests : public DrmCommandStreamEnhancedTest { template void TearDownT() { - if (PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]) == PreemptionMode::MidThread) { + if (PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo) == PreemptionMode::MidThread) { device->getMemoryManager()->freeGraphicsMemory((GlobalMockSipProgram::sipProgram)->getAllocation()); GlobalMockSipProgram::sipProgram->resetAllocation(tmpAllocation); } diff --git a/opencl/test/unit_test/os_interface/linux/os_time_test.cpp b/opencl/test/unit_test/os_interface/linux/os_time_test.cpp index 398e231c75..9605fc3969 100644 --- a/opencl/test/unit_test/os_interface/linux/os_time_test.cpp +++ b/opencl/test/unit_test/os_interface/linux/os_time_test.cpp @@ -191,7 +191,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlFailsThenDefaultRes drm->getParamRetValue = 0; drm->ioctl_res = -1; - auto result = osTime->getDynamicDeviceTimerResolution(*platformDevices[0]); + auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo); EXPECT_DOUBLE_EQ(result, defaultResolution); } @@ -200,7 +200,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenNoDrmThenDefaultResoluti auto defaultResolution = platformDevices[0]->capabilityTable.defaultProfilingTimerResolution; - auto result = osTime->getDynamicDeviceTimerResolution(*platformDevices[0]); + auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo); EXPECT_DOUBLE_EQ(result, defaultResolution); } @@ -212,7 +212,7 @@ TEST_F(DrmTimeTest, givenGpuTimestampResolutionQueryWhenIoctlSuccedsThenCorrectR drm->getParamRetValue = 19200000; drm->ioctl_res = 0; - auto result = osTime->getDynamicDeviceTimerResolution(*platformDevices[0]); + auto result = osTime->getDynamicDeviceTimerResolution(*defaultHwInfo); EXPECT_DOUBLE_EQ(result, 52.08333333333333); } diff --git a/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp b/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp index 10748e3914..39ac93da1b 100644 --- a/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/gl/gl_os_sharing_tests.cpp @@ -334,10 +334,10 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza } }; FailSignalSyncObjectMock::reset(); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); CL_GL_SYNC_INFO syncInfo = {}; @@ -395,10 +395,10 @@ TEST_F(GlArbSyncEventOsTest, GivenCallToSignalArbSyncObjectWhenSignalSynchroniza } }; FailSignalSyncObjectMock::reset(); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); OsContextWin osContext(*osInterface.get()->getWddm(), 0u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); CL_GL_SYNC_INFO syncInfo = {}; diff --git a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index e59f3be7f5..317c6455ab 100644 --- a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -105,7 +105,7 @@ TEST_F(HwInfoConfigTestWindows, givenInstrumentationForHardwareIsEnabledOrDisabl } HWTEST_F(HwInfoConfigTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoThenSetCoherencySupportCorrectly) { - HardwareInfo initialHwInfo = **platformDevices; + HardwareInfo initialHwInfo = *defaultHwInfo; auto &hwHelper = HwHelper::get(initialHwInfo.platform.eRenderCoreFamily); auto hwInfoConfig = HwInfoConfig::get(initialHwInfo.platform.eProductFamily); diff --git a/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp index c64bc26ca3..99d74e7f75 100644 --- a/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_context_win_tests.cpp @@ -15,8 +15,8 @@ using namespace NEO; struct OsContextWinTest : public WddmTestWithMockGdiDll { void SetUp() override { WddmTestWithMockGdiDll::SetUp(); - preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); - engineType = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0]; + preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); + engineType = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0]; init(); } diff --git a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp index 1ae55ed87a..cf473f9cc8 100644 --- a/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/os_interface_win_tests.cpp @@ -30,11 +30,11 @@ TEST(OsContextTest, givenWddmWhenCreateOsContextAfterInitWddmThenOsContextIsInit auto wddm = new WddmMock(rootDeviceEnvironment); OSInterface osInterface; osInterface.get()->setWddm(wddm); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); EXPECT_EQ(0u, wddm->registerTrimCallbackResult.called); auto osContext = std::make_unique(*wddm, 0u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); EXPECT_TRUE(osContext->isInitialized()); EXPECT_EQ(osContext->getWddm(), wddm); diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index 080e378f40..1a7da50042 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -168,7 +168,7 @@ TEST(Wddm20EnumAdaptersTest, givenEmptyHardwareInfoWhenEnumAdapterIsCalledThenCa } TEST(Wddm20EnumAdaptersTest, givenUnknownPlatformWhenEnumAdapterIsCalledThenFalseIsReturnedAndOutputIsEmpty) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.platform.eProductFamily = IGFX_UNKNOWN; std::unique_ptr mockGdiDll(setAdapterInfo(&hwInfo.platform, &hwInfo.gtSystemInfo, @@ -181,7 +181,7 @@ TEST(Wddm20EnumAdaptersTest, givenUnknownPlatformWhenEnumAdapterIsCalledThenFals EXPECT_FALSE(ret); // reset mock gdi - hwInfo = *platformDevices[0]; + hwInfo = *defaultHwInfo; mockGdiDll.reset(setAdapterInfo(&hwInfo.platform, &hwInfo.gtSystemInfo, hwInfo.capabilityTable.gpuAddressSpace)); @@ -516,7 +516,7 @@ HWTEST_F(Wddm20InstrumentationTest, configureDeviceAddressSpaceOnInit) { D3DKMT_HANDLE adapterHandle = ADAPTER_HANDLE; D3DKMT_HANDLE deviceHandle = DEVICE_HANDLE; - const HardwareInfo hwInfo = *platformDevices[0]; + const HardwareInfo hwInfo = *defaultHwInfo; BOOLEAN FtrL3IACoherency = hwInfo.featureTable.ftrL3IACoherency ? 1 : 0; uintptr_t maxAddr = hwInfo.capabilityTable.gpuAddressSpace >= MemoryConstants::max64BitAppAddress ? reinterpret_cast(sysInfo.lpMaximumApplicationAddress) + 1 @@ -598,7 +598,7 @@ TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenUseNoRingFlushesKmdModeDeb TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenEngineTypeWhenCreatingContextThenPassCorrectNodeOrdinal) { init(); auto createContextParams = this->getCreateContextDataFcn(); - UINT expected = WddmEngineMapper::engineNodeMap(HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0]); + UINT expected = WddmEngineMapper::engineNodeMap(HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0]); EXPECT_EQ(expected, createContextParams->NodeOrdinal); } diff --git a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp index 58854b21a0..f38a77bbb9 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm23_tests.cpp @@ -39,12 +39,12 @@ struct Wddm23TestsWithoutWddmInit : public ::testing::Test, GdiDllFixture { } void init() { - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddmMockInterface = static_cast(wddm->wddmInterface.release()); wddm->init(); wddm->wddmInterface.reset(wddmMockInterface); osContext = std::make_unique(*wddm, 0u, 1, - HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0], + HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0], preemptionMode, false, false, false); } @@ -77,7 +77,7 @@ TEST_F(Wddm23Tests, whenCreateContextIsCalledThenEnableHwQueues) { } TEST_F(Wddm23Tests, givenPreemptionModeWhenCreateHwQueueCalledThenSetGpuTimeoutIfEnabled) { - auto defaultEngine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*platformDevices[0])[0]; + auto defaultEngine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo)[0]; OsContextWin osContextWithoutPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::Disabled, false, false, false); OsContextWin osContextWithPreemption(*osInterface->get()->getWddm(), 0u, 1, defaultEngine, PreemptionMode::MidBatch, diff --git a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h index b9df7b3547..b191664fa0 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_fixture.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_fixture.h @@ -43,7 +43,7 @@ struct WddmFixture : ::testing::Test { rootDeviceEnvironemnt->osInterface->get()->setWddm(wddm); rootDeviceEnvironemnt->memoryOperationsInterface = std::make_unique(wddm); osInterface = rootDeviceEnvironemnt->osInterface.get(); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); auto hwInfo = rootDeviceEnvironemnt->getHardwareInfo(); auto engine = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily).getGpgpuEngineInstances(*hwInfo)[0]; @@ -77,7 +77,7 @@ struct WddmFixtureWithMockGdiDll : public GdiDllFixture { } void init() { - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddmMockInterface = static_cast(wddm->wddmInterface.release()); wddm->init(); wddm->wddmInterface.reset(wddmMockInterface); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index a3bfb0a3fa..1cb0601dd4 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -79,7 +79,7 @@ TEST(WddmMemoryManager, NonAssignable) { TEST(WddmAllocationTest, givenAllocationIsTrimCandidateInOneOsContextWhenGettingTrimCandidatePositionThenReturnItsPositionAndUnusedPositionInOtherContexts) { MockWddmAllocation allocation; MockOsContext osContext(1u, 1, aub_stream::ENGINE_RCS, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); allocation.setTrimCandidateListPosition(osContext.getContextId(), 700u); EXPECT_EQ(trimListUnusedPosition, allocation.getTrimCandidateListPosition(0u)); @@ -1464,11 +1464,11 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenC std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u)); std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u)); memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); EXPECT_FALSE(memoryManager->isMemoryBudgetExhausted()); } @@ -1489,11 +1489,11 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithE std::unique_ptr csr1(createCommandStream(*executionEnvironment, 1u)); std::unique_ptr csr2(createCommandStream(*executionEnvironment, 2u)); memoryManager->createAndRegisterOsContext(csr.get(), aub_stream::ENGINE_RCS, 1, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr1.get(), aub_stream::ENGINE_RCS, 2, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); memoryManager->createAndRegisterOsContext(csr2.get(), aub_stream::ENGINE_RCS, 3, - PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false, false, false); + PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo), false, false, false); auto osContext = static_cast(memoryManager->getRegisteredEngines()[1].osContext); osContext->getResidencyController().setMemoryBudgetExhausted(); EXPECT_TRUE(memoryManager->isMemoryBudgetExhausted()); @@ -1734,7 +1734,7 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen ExecutionEnvironment &executionEnvironment = *platform()->peekExecutionEnvironment(); auto csr = std::unique_ptr(createCommandStream(executionEnvironment, 0)); auto wddm = new WddmMock(*executionEnvironment.rootDeviceEnvironments[0].get()); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); executionEnvironment.rootDeviceEnvironments[0]->osInterface = std::make_unique(); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h index 14d6e15585..fd8b9a5e65 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.h @@ -111,7 +111,7 @@ class WddmMemoryManagerFixtureWithGmockWddm : public ExecutionEnvironmentFixture wddm = new NiceMock(*executionEnvironment->rootDeviceEnvironments[0].get()); executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); ASSERT_NE(nullptr, wddm); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); executionEnvironment->rootDeviceEnvironments[0]->osInterface->get()->setWddm(wddm); executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique(wddm); diff --git a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 081a67a9c3..5aaddd78eb 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -121,7 +121,7 @@ struct WddmResidencyControllerWithMockWddmTest : public WddmResidencyControllerT wddm = new ::testing::NiceMock(*executionEnvironment->rootDeviceEnvironments[0].get()); wddm->resetGdi(new MockGdi()); - auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]); + auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(*defaultHwInfo); wddm->init(); executionEnvironment->rootDeviceEnvironments[0]->osInterface = std::make_unique(); diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index c3dead2784..3c8c4d8e2e 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -287,7 +287,7 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching } TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFillMatchingSubstringAndFillMandatoryTrailingSpace) { - HardwareInfo TesthwInfo = *platformDevices[0]; + HardwareInfo TesthwInfo = *defaultHwInfo; TesthwInfo.capabilityTable.ftrSupportsFP64 = false; TesthwInfo.capabilityTable.clVersionSupport = 10; @@ -321,7 +321,7 @@ TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchi } TEST_F(PlatformTest, givenSupporteImagesAndClVersion21WhenCreateExtentionsListThenDeviceReportsSpritvMediaBlockIoExtension) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; hwInfo.capabilityTable.clVersionSupport = 21; std::string extensionsList = getExtensionsList(hwInfo); @@ -331,7 +331,7 @@ TEST_F(PlatformTest, givenSupporteImagesAndClVersion21WhenCreateExtentionsListTh } TEST_F(PlatformTest, givenNotSupporteImagesAndClVersion21WhenCreateExtentionsListThenDeviceNotReportsSpritvMediaBlockIoExtension) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = false; hwInfo.capabilityTable.clVersionSupport = 21; std::string extensionsList = getExtensionsList(hwInfo); diff --git a/opencl/test/unit_test/profiling/profiling_tests.cpp b/opencl/test/unit_test/profiling/profiling_tests.cpp index 6fc712ba04..d48f69ffb2 100644 --- a/opencl/test/unit_test/profiling/profiling_tests.cpp +++ b/opencl/test/unit_test/profiling/profiling_tests.cpp @@ -527,7 +527,7 @@ struct ProfilingWithPerfCountersTests : public PerformanceCountersFixture, ::tes PerformanceCountersFixture::SetUp(); createPerfCounters(); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; if (hwInfo.capabilityTable.defaultEngineType == aub_stream::EngineType::ENGINE_CCS) { hwInfo.featureTable.ftrCCSNode = true; } diff --git a/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp b/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp index 324c11efe1..aad73a8cf3 100644 --- a/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp +++ b/opencl/test/unit_test/scheduler/scheduler_kernel_tests.cpp @@ -301,7 +301,7 @@ TEST(SchedulerKernelTest, givenForcedSchedulerGwsByDebugVariableWhenSchedulerKer } TEST(SchedulerKernelTest, givenSimulationModeWhenSchedulerKernelIsCreatedThenGwsIsSetToOneWorkgroup) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrSimulationMode = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); @@ -317,7 +317,7 @@ TEST(SchedulerKernelTest, givenForcedSchedulerGwsByDebugVariableAndSimulationMod DebugManagerStateRestore dbgRestorer; DebugManager.flags.SchedulerGWS.set(48); - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.featureTable.ftrSimulationMode = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); diff --git a/opencl/test/unit_test/ult_config_listener.cpp b/opencl/test/unit_test/ult_config_listener.cpp index 9e3d157329..e181691882 100644 --- a/opencl/test/unit_test/ult_config_listener.cpp +++ b/opencl/test/unit_test/ult_config_listener.cpp @@ -16,7 +16,7 @@ #include "opencl/test/unit_test/mocks/mock_platform.h" void NEO::UltConfigListener::OnTestStart(const ::testing::TestInfo &testInfo) { - referencedHwInfo = *platformDevices[0]; + referencedHwInfo = *defaultHwInfo; auto executionEnvironment = constructPlatform()->peekExecutionEnvironment(); executionEnvironment->prepareRootDeviceEnvironments(1); executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(*platformDevices); diff --git a/shared/test/unit_test/gen11/test_preamble_gen11.cpp b/shared/test/unit_test/gen11/test_preamble_gen11.cpp index 4eb99c5737..140ea13c4b 100644 --- a/shared/test/unit_test/gen11/test_preamble_gen11.cpp +++ b/shared/test/unit_test/gen11/test_preamble_gen11.cpp @@ -18,7 +18,7 @@ typedef PreambleFixture IclSlm; GEN11TEST_F(IclSlm, shouldBeEnabledOnGen11) { typedef ICLFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); PreambleHelper::programL3(&cs, l3Config); parseCommands(cs); @@ -33,7 +33,7 @@ GEN11TEST_F(IclSlm, shouldBeEnabledOnGen11) { } GEN11TEST_F(IclSlm, givenGen11WhenProgramingL3ThenErrorDetectionBehaviorControlBitSet) { - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); uint32_t errorDetectionBehaviorControlBit = 1 << 9; @@ -42,7 +42,7 @@ GEN11TEST_F(IclSlm, givenGen11WhenProgramingL3ThenErrorDetectionBehaviorControlB GEN11TEST_F(IclSlm, givenGen11IsL3Programing) { bool isL3Programmable = - PreambleHelper::isL3Configurable(**platformDevices); + PreambleHelper::isL3Configurable(*defaultHwInfo); EXPECT_FALSE(isL3Programmable); } @@ -92,7 +92,7 @@ GEN11TEST_F(Gen11PreambleVfeState, WaOn) { typedef PreambleFixture PreemptionWatermarkGen11; GEN11TEST_F(PreemptionWatermarkGen11, givenPreambleThenPreambleWorkAroundsIsNotProgrammed) { - PreambleHelper::programGenSpecificPreambleWorkArounds(&linearStream, **platformDevices); + PreambleHelper::programGenSpecificPreambleWorkArounds(&linearStream, *defaultHwInfo); parseCommands(linearStream); @@ -116,7 +116,7 @@ GEN11TEST_F(ThreadArbitrationGen11, givenPreambleWhenItIsProgrammedThenThreadArb typedef ICLFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; typedef ICLFamily::PIPE_CONTROL PIPE_CONTROL; LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); MockDevice mockDevice; PreambleHelper::programPreamble(&linearStream, mockDevice, l3Config, ThreadArbitrationPolicy::RoundRobin, diff --git a/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp b/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp index de018744d0..e61a0eb9ba 100644 --- a/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp +++ b/shared/test/unit_test/gen12lp/test_preamble_gen12lp.cpp @@ -32,7 +32,7 @@ TGLLPTEST_F(TglLpSlm, givenTglLpWhenPreambleIsBeingProgrammedThenThreadArbitrati TGLLPTEST_F(TglLpSlm, givenTglLpIsL3Programing) { bool isL3Programmable = - PreambleHelper::isL3Configurable(**platformDevices); + PreambleHelper::isL3Configurable(*defaultHwInfo); EXPECT_FALSE(isL3Programmable); } diff --git a/shared/test/unit_test/gen8/test_preamble_gen8.cpp b/shared/test/unit_test/gen8/test_preamble_gen8.cpp index 4079d22cf2..f358b081f6 100644 --- a/shared/test/unit_test/gen8/test_preamble_gen8.cpp +++ b/shared/test/unit_test/gen8/test_preamble_gen8.cpp @@ -19,7 +19,7 @@ typedef PreambleFixture BdwSlm; BDWTEST_F(BdwSlm, shouldBeEnabledOnGen8) { typedef BDWFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); PreambleHelper::programL3(&cs, l3Config); parseCommands(cs); @@ -62,10 +62,10 @@ BDWTEST_F(Gen8L3Config, givenGen8IsL3Programing) { bool isL3Programmable; l3ConfigDifference = - PreambleHelper::getL3Config(**platformDevices, true) != - PreambleHelper::getL3Config(**platformDevices, false); + PreambleHelper::getL3Config(*defaultHwInfo, true) != + PreambleHelper::getL3Config(*defaultHwInfo, false); isL3Programmable = - PreambleHelper::isL3Configurable(**platformDevices); + PreambleHelper::isL3Configurable(*defaultHwInfo); EXPECT_EQ(l3ConfigDifference, isL3Programmable); } @@ -95,7 +95,7 @@ BDWTEST_F(PreambleVfeState, basic) { typedef BDWFamily::PIPE_CONTROL PIPE_CONTROL; LinearStream &cs = linearStream; - PreambleHelper::programVFEState(&linearStream, **platformDevices, 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS); + PreambleHelper::programVFEState(&linearStream, *defaultHwInfo, 0, 0, 168u, aub_stream::EngineType::ENGINE_RCS); parseCommands(cs); diff --git a/shared/test/unit_test/gen9/preamble_tests_gen9.cpp b/shared/test/unit_test/gen9/preamble_tests_gen9.cpp index f7ade1bd10..034d6481aa 100644 --- a/shared/test/unit_test/gen9/preamble_tests_gen9.cpp +++ b/shared/test/unit_test/gen9/preamble_tests_gen9.cpp @@ -54,10 +54,10 @@ GEN9TEST_F(PreambleTestGen9, givenGen9IsL3Programing) { bool isL3Programmable; l3ConfigDifference = - PreambleHelper::getL3Config(**platformDevices, true) != - PreambleHelper::getL3Config(**platformDevices, false); + PreambleHelper::getL3Config(*defaultHwInfo, true) != + PreambleHelper::getL3Config(*defaultHwInfo, false); isL3Programmable = - PreambleHelper::isL3Configurable(**platformDevices); + PreambleHelper::isL3Configurable(*defaultHwInfo); EXPECT_EQ(l3ConfigDifference, isL3Programmable); } diff --git a/shared/test/unit_test/gen9/skl/test_preamble_skl.cpp b/shared/test/unit_test/gen9/skl/test_preamble_skl.cpp index d525c93761..741736ca5b 100644 --- a/shared/test/unit_test/gen9/skl/test_preamble_skl.cpp +++ b/shared/test/unit_test/gen9/skl/test_preamble_skl.cpp @@ -21,7 +21,7 @@ typedef PreambleFixture SklSlm; SKLTEST_F(SklSlm, shouldBeEnabledOnGen9) { typedef SKLFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); PreambleHelper::programL3(&cs, l3Config); @@ -77,7 +77,7 @@ SKLTEST_F(ThreadArbitration, givenPreambleWhenItIsProgrammedThenThreadArbitratio typedef SKLFamily::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM; typedef SKLFamily::PIPE_CONTROL PIPE_CONTROL; LinearStream &cs = linearStream; - uint32_t l3Config = PreambleHelper::getL3Config(**platformDevices, true); + uint32_t l3Config = PreambleHelper::getL3Config(*defaultHwInfo, true); MockDevice mockDevice; PreambleHelper::programPreamble(&linearStream, mockDevice, l3Config, ThreadArbitrationPolicy::RoundRobin, diff --git a/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp index 12a8796074..613908cb25 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_preemption_tests.cpp @@ -19,7 +19,7 @@ class WddmPreemptionTests : public Test { public: void SetUp() override { WddmFixtureWithMockGdiDll::SetUp(); - const HardwareInfo hwInfo = *platformDevices[0]; + const HardwareInfo hwInfo = *defaultHwInfo; memcpy(&hwInfoTest, &hwInfo, sizeof(hwInfoTest)); dbgRestorer = new DebugManagerStateRestore(); wddm->featureTable->ftrGpGpuMidThreadLevelPreempt = true; diff --git a/shared/test/unit_test/preamble/preamble_tests.cpp b/shared/test/unit_test/preamble/preamble_tests.cpp index 2a58a7f3b5..a10bd2cdea 100644 --- a/shared/test/unit_test/preamble/preamble_tests.cpp +++ b/shared/test/unit_test/preamble/preamble_tests.cpp @@ -183,7 +183,7 @@ HWTEST_F(PreambleTest, givenKernelDebuggingActiveAndMidThreadPreemptionWhenGetAd } HWTEST_F(PreambleTest, givenDefaultPreambleWhenGetThreadsMaxNumberIsCalledThenMaximumNumberOfThreadsIsReturned) { - const HardwareInfo &hwInfo = **platformDevices; + const HardwareInfo &hwInfo = *defaultHwInfo; uint32_t threadsPerEU = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU; uint32_t value = HwHelper::getMaxThreadsForVfe(hwInfo); diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index 8c2823365b..9bfc2fa3eb 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -519,7 +519,7 @@ INSTANTIATE_TEST_CASE_P( ::testing::Values(PreemptionMode::Disabled, PreemptionMode::MidBatch, PreemptionMode::ThreadGroup)); HWTEST_F(MidThreadPreemptionTests, createCsrSurfaceNoWa) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.workaroundTable.waCSRUncachable = false; std::unique_ptr mockDevice(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); @@ -558,7 +558,7 @@ HWTEST_F(MidThreadPreemptionTests, givenMidThreadPreemptionWhenFailingOnCsrSurfa } HWTEST_F(MidThreadPreemptionTests, createCsrSurfaceWa) { - HardwareInfo hwInfo = *platformDevices[0]; + HardwareInfo hwInfo = *defaultHwInfo; hwInfo.workaroundTable.waCSRUncachable = true; std::unique_ptr mockDevice(MockDevice::createWithNewExecutionEnvironment(&hwInfo));