From 347cef9fcba6750dd5b5bd2dd7b605e7fce19a43 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Thu, 5 Jan 2023 13:40:36 +0000 Subject: [PATCH] refactor: don't use global ProductHelper getter in ocl files 3/n Related-To: NEO-6853 Signed-off-by: Kamil Kopryk --- .../unit_test/mem_obj/buffer_bcs_tests.cpp | 9 +++--- .../mem_obj/mem_obj_helper_tests.cpp | 5 ++- .../memory_manager/memory_manager_tests.cpp | 6 ++-- .../os_interface/windows/wddm20_tests.cpp | 5 ++- .../windows/wddm_memory_manager_tests.cpp | 15 ++++++--- .../wddm_residency_controller_tests.cpp | 10 +++--- .../sharings/gl/windows/gl_texture_tests.cpp | 2 +- .../xe_hpc_core/api_tests_xe_hpc_core.cpp | 4 +-- .../hw_helper_tests_xe_hpc_core.cpp | 32 +++++++++---------- .../pvc/cl_hw_helper_tests_pvc.cpp | 6 ++-- .../command_stream_receiver_hw_tests_pvc.cpp | 6 ++-- .../copy_engine_tests_xe_hpg_core.cpp | 4 +-- .../dg2/test_cmds_programming_dg2.cpp | 4 +-- 13 files changed, 57 insertions(+), 51 deletions(-) diff --git a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp index de4f8e5f14..7a2272a7f5 100644 --- a/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_bcs_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -75,8 +75,8 @@ struct BcsBufferTests : public ::testing::Test { auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = true; device = std::make_unique(MockClDevice::createWithNewExecutionEnvironment(&hwInfo)); - - if (!ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isBlitterFullySupported(device->getHardwareInfo())) { + auto &productHelper = device->getProductHelper(); + if (!productHelper.isBlitterFullySupported(device->getHardwareInfo())) { GTEST_SKIP(); } @@ -143,8 +143,9 @@ HWTEST_F(NoBcsBufferTests, givenProductWithNoFullyBlitterSupportWhenCreatingBuff auto hwInfo = *defaultHwInfo; hwInfo.capabilityTable.blitterOperationsSupported = false; - EXPECT_FALSE(ProductHelper::get(hwInfo.platform.eProductFamily)->isBlitterFullySupported(hwInfo)); std::unique_ptr newDevice = std::make_unique(MockClDevice::createWithNewExecutionEnvironment(&hwInfo, rootDeviceIndex)); + auto &productHelper = newDevice->getProductHelper(); + EXPECT_FALSE(productHelper.isBlitterFullySupported(hwInfo)); std::unique_ptr newBcsMockContext = std::make_unique(newDevice.get()); auto bcsCsr = static_cast *>(newBcsMockContext->bcsCsr.get()); diff --git a/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp index bb52555dcc..7a0af28aeb 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_helper_tests.cpp @@ -8,6 +8,7 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/common/utilities/base_object_utils.h" @@ -417,7 +418,9 @@ TEST(MemObjHelper, givenDifferentValuesWhenCheckingBufferCompressionSupportThenC uint32_t contextTypes[] = {ContextType::CONTEXT_TYPE_DEFAULT, ContextType::CONTEXT_TYPE_SPECIALIZED, ContextType::CONTEXT_TYPE_UNRESTRICTIVE}; __REVID steppingValues[] = {REVISION_A0, REVISION_B}; - const auto &productHelper = *ProductHelper::get(defaultHwInfo->platform.eProductFamily); + + MockExecutionEnvironment mockExecutionEnvironemnt{}; + const auto &productHelper = mockExecutionEnvironemnt.rootDeviceEnvironments[0]->getProductHelper(); for (auto stepping : steppingValues) { hardwareStepping = productHelper.getHwRevIdFromStepping(stepping, *defaultHwInfo); 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 5346a23ef4..138762c652 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -3054,9 +3054,9 @@ HWTEST_F(PageTableManagerTest, givenMemoryManagerThatSupportsPageTableManagerWhe MockGmm gmm(executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getGmmHelper()); allocation.setDefaultGmm(&gmm); bool mapped = memoryManager->mapAuxGpuVA(&allocation); - auto hwInfo = executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getHardwareInfo(); - - EXPECT_EQ(ProductHelper::get(hwInfo->platform.eProductFamily)->isPageTableManagerSupported(*hwInfo), mapped); + auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getHardwareInfo(); + auto &productHelper = executionEnvironment->rootDeviceEnvironments[allocation.getRootDeviceIndex()]->getHelper(); + EXPECT_EQ(productHelper.isPageTableManagerSupported(hwInfo), mapped); } TEST(MemoryManagerTest, givenDebugModuleAreaAllocationTypeWhenCallingGetAllocationDataThenUse32BitFrontWindowsIsSet) { 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 7f1fb52841..328f9f050d 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -788,9 +788,8 @@ TEST_F(Wddm20Tests, WhenMakingNonResidentAndEvictNotNeededThenEvictIsCalledWithP DebugManagerStateRestore restorer{}; DebugManager.flags.PlaformSupportEvictIfNecessaryFlag.set(1); - auto productFamily = rootDeviceEnvironment->getHardwareInfo()->platform.eProductFamily; - ProductHelper *productHelper = ProductHelper::get(productFamily); - wddm->setPlatformSupportEvictIfNecessaryFlag(*productHelper); + auto &productHelper = rootDeviceEnvironment->getHelper(); + wddm->setPlatformSupportEvictIfNecessaryFlag(productHelper); D3DKMT_HANDLE handle = (D3DKMT_HANDLE)0x1234; 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 b20012a5a4..2cff3a5404 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 @@ -1990,7 +1990,8 @@ TEST_F(MockWddmMemoryManagerTest, givenDisabledAsyncDeleterFlagWhenMemoryManager } TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThenUseWddmToMap) { - if (!ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) { + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + if (!productHelper.isPageTableManagerSupported(*defaultHwInfo)) { GTEST_SKIP(); } wddm->init(); @@ -2026,7 +2027,8 @@ TEST_F(MockWddmMemoryManagerTest, givenPageTableManagerWhenMapAuxGpuVaCalledThen } TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPageTableNotSupportedThenMapAuxVa) { - if (ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) { + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + if (!productHelper.isPageTableManagerSupported(*defaultHwInfo)) { GTEST_SKIP(); } auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[1].get(); @@ -2059,7 +2061,8 @@ TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPag } TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPageTableSupportedThenMapAuxVa) { - if (!ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) { + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + if (!productHelper.isPageTableManagerSupported(*defaultHwInfo)) { GTEST_SKIP(); } auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[1].get(); @@ -2100,7 +2103,8 @@ TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationWhenMappedGpuVaAndPag } TEST_F(MockWddmMemoryManagerTest, givenCompressedAllocationAndPageTableSupportedWhenReleaseingThenUnmapAuxVa) { - if (!ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) { + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + if (!productHelper.isPageTableManagerSupported(*defaultHwInfo)) { GTEST_SKIP(); } wddm->init(); @@ -2234,7 +2238,8 @@ TEST_F(MockWddmMemoryManagerTest, givenCompressedFlagSetWhenInternalIsUnsetThenD } TEST_F(MockWddmMemoryManagerTest, givenCompressedFlagSetWhenInternalIsSetThenUpdateAuxTable) { - if (!ProductHelper::get(defaultHwInfo->platform.eProductFamily)->isPageTableManagerSupported(*defaultHwInfo)) { + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + if (!productHelper.isPageTableManagerSupported(*defaultHwInfo)) { GTEST_SKIP(); } D3DGPU_VIRTUAL_ADDRESS gpuVa = 0; 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 1796bad37e..85b5aee872 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 @@ -503,9 +503,8 @@ TEST_F(WddmResidencyControllerWithGdiTest, givenNotUsedAllocationsFromPreviousPe DebugManagerStateRestore restorer{}; DebugManager.flags.PlaformSupportEvictIfNecessaryFlag.set(1); - auto productFamily = rootDeviceEnvironment->getHardwareInfo()->platform.eProductFamily; - ProductHelper *productHelper = ProductHelper::get(productFamily); - wddm->setPlatformSupportEvictIfNecessaryFlag(*productHelper); + auto &productHelper = rootDeviceEnvironment->getHelper(); + wddm->setPlatformSupportEvictIfNecessaryFlag(productHelper); D3DKMT_TRIMNOTIFICATION trimNotification = {0}; trimNotification.Flags.PeriodicTrim = 1; @@ -588,9 +587,8 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, givenTripleAllocation DebugManagerStateRestore restorer{}; DebugManager.flags.PlaformSupportEvictIfNecessaryFlag.set(1); - auto productFamily = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily; - ProductHelper *productHelper = ProductHelper::get(productFamily); - wddm->setPlatformSupportEvictIfNecessaryFlag(*productHelper); + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + wddm->setPlatformSupportEvictIfNecessaryFlag(productHelper); D3DKMT_TRIMNOTIFICATION trimNotification = {0}; trimNotification.Flags.PeriodicTrim = 1; diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp index 56f3e5142e..179d2daa15 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp @@ -544,7 +544,7 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedWithUnifiedAuxSur auto glTexture = std::unique_ptr(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_WRITE_ONLY, GL_SRGB8_ALPHA8, 0, textureId, &retVal)); const auto &hwInfo = clContext->getDevice(0)->getHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); + const auto &productHelper = clContext->getDevice(0)->getProductHelper(); uint32_t expectedMapAuxGpuVaCalls = productHelper.isPageTableManagerSupported(hwInfo) ? 1 : 0; EXPECT_EQ(expectedMapAuxGpuVaCalls, tempMM->mapAuxGpuVACalled); diff --git a/opencl/test/unit_test/xe_hpc_core/api_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/api_tests_xe_hpc_core.cpp index 2f49ed6379..3dcfa053d8 100644 --- a/opencl/test/unit_test/xe_hpc_core/api_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/api_tests_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -19,7 +19,7 @@ XE_HPC_CORETEST_F(EnqueueKernelTestGenXeHpcCore, givenCommandQueueWithCCCSEngine cl_int retVal = CL_SUCCESS; auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); + auto &productHelper = pDevice->getProductHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); pProgram->mockKernelInfo.kernelDescriptor.kernelAttributes.flags.usesSyncBuffer = true; diff --git a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp index 9535b3db3e..17e861cdcd 100644 --- a/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/hw_helper_tests_xe_hpc_core.cpp @@ -80,8 +80,8 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenSingleTileBdA0CsrWhenAllocat } else { EXPECT_EQ(AllocationType::LINEAR_STREAM, heapAllocation->getAllocationType()); } - - if (ProductHelper::get(hwInfo->platform.eProductFamily)->isTilePlacementResourceWaRequired(*hwInfo)) { + auto &productHelper = clDevice->getProductHelper(); + if (productHelper.isTilePlacementResourceWaRequired(*hwInfo)) { EXPECT_EQ(tile0Mask, heapAllocation->storageInfo.memoryBanks); } @@ -117,7 +117,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, GivenBarrierEncodingWhenCallingGe XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCccsDisabledButDebugVariableSetWhenIsCooperativeEngineSupportedEnabledAndGetGpgpuEnginesCalledThenSetCccsProperly) { HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = 1; @@ -152,7 +152,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCccsDisabledButDebugVariable XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCccsDisabledWhenIsCooperativeEngineSupportedEnabledAndGetGpgpuEnginesCalledThenDontSetCccs) { HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = 1; @@ -185,7 +185,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBcsDisabledWhenIsCooperative const size_t numEngines = 11; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = 0; @@ -229,7 +229,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenOneBcsEnabledWhenIsCooperati const size_t numEngines = 13; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = 1; @@ -276,7 +276,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenNotAllCopyEnginesWhenIsCoope const size_t numEngines = 10; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9); @@ -324,7 +324,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenOneCcsEnabledWhenIsCooperati const size_t numEngines = 16; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9); @@ -374,7 +374,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenCccsAsDefaultEngineWhenIsCoo const size_t numEngines = 22; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9); @@ -430,7 +430,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, whenIsCooperativeEngineSupportedE const size_t numEngines = 22; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9); @@ -486,7 +486,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, whenIsCooperativeEngineSupportedE const size_t numEngines = 22; HardwareInfo hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.featureTable.flags.ftrCCSNode = true; hwInfo.featureTable.ftrBcsInfo = maxNBitValue(9); @@ -662,7 +662,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenGfxCoreHelperWhenGettingThre using ProductHelperTestXeHpcCore = Test; XE_HPC_CORETEST_F(ProductHelperTestXeHpcCore, givenDefaultProductHelperHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned) { - auto &productHelper = *ProductHelper::get(defaultHwInfo->platform.eProductFamily); + auto &productHelper = getHelper(); MockGraphicsAllocation allocation; allocation.overrideMemoryPool(MemoryPool::LocalMemory); allocation.setAllocationType(AllocationType::BUFFER_HOST_MEMORY); @@ -731,7 +731,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenBcsSubDeviceSupportI HardwareInfo hwInfo = *defaultHwInfo; auto &gfxCoreHelper = getHelper(); - auto productHelper = ProductHelper::get(productFamily); + auto &productHelper = getHelper(); constexpr uint8_t bdRev[4] = {0, 0b111001, 0b101001, 0b000101}; @@ -751,7 +751,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenBcsSubDeviceSupportI (aub_stream::ENGINE_BCS == engineTypeT || aub_stream::ENGINE_BCS1 == engineTypeT || aub_stream::ENGINE_BCS3 == engineTypeT)); - bool isBdA0 = productHelper->isBcsReportWaRequired(hwInfo); + bool isBdA0 = productHelper.isBcsReportWaRequired(hwInfo); bool applyWa = affectedEngine; applyWa &= isBdA0 || (debugFlag == 1); @@ -769,7 +769,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZ HardwareInfo hwInfo = *defaultHwInfo; auto &gfxCoreHelper = getHelper(); - auto productHelper = ProductHelper::get(productFamily); + auto &productHelper = getHelper(); constexpr uint8_t bdRev[4] = {0, 0b111001, 0b101001, 0b000101}; constexpr DeviceBitfield originalTileMasks[4] = {0b1, 0b11, 0b10, 0b1011}; @@ -785,7 +785,7 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenBdA0WhenAllocatingOnNonTileZ for (auto rev : bdRev) { hwInfo.platform.usRevId = rev; - bool isBdA0 = productHelper->isTilePlacementResourceWaRequired(hwInfo); + bool isBdA0 = productHelper.isTilePlacementResourceWaRequired(hwInfo); for (auto originalMask : originalTileMasks) { AllocationData allocData; diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp index bcd6a8db5d..3682cbbbce 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/cl_hw_helper_tests_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ using ClGfxCoreHelperTestsPvcXt = Test; PVCTEST_F(ClGfxCoreHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInProperMemoryPool) { auto hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(&hwInfo); @@ -26,7 +26,7 @@ PVCTEST_F(ClGfxCoreHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrS PVCTEST_F(ClGfxCoreHelperTestsPvcXt, givenMultiTileCsrOnPvcWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInLocalMemoryPool) { auto hwInfo = *defaultHwInfo; - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); + auto &productHelper = getHelper(); hwInfo.platform.usDeviceID = pvcXtDeviceIds.front(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0 checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(&hwInfo); diff --git a/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp b/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp index e75268af99..4d23062f48 100644 --- a/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp +++ b/opencl/test/unit_test/xe_hpc_core/pvc/command_stream_receiver_hw_tests_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -83,10 +83,10 @@ PVCTEST_F(PvcCommandStreamReceiverFlushTaskTests, givenRevisionBAndAboveWhenLast {0x6, false}, {0x7, false}, }; - auto productHelper = ProductHelper::get(hwInfo->platform.eProductFamily); + auto &productHelper = pDevice->getProductHelper(); for (auto &testInput : testInputs) { hwInfo->platform.usRevId = testInput.revId; - productHelper->fillPipelineSelectPropertiesSupportStructure(commandStreamReceiver.pipelineSupportFlags, *hwInfo); + productHelper.fillPipelineSelectPropertiesSupportStructure(commandStreamReceiver.pipelineSupportFlags, *hwInfo); commandStreamReceiver.isPreambleSent = true; commandStreamReceiver.lastMediaSamplerConfig = false; commandStreamReceiver.lastSystolicPipelineSelectMode = false; diff --git a/opencl/test/unit_test/xe_hpg_core/copy_engine_tests_xe_hpg_core.cpp b/opencl/test/unit_test/xe_hpg_core/copy_engine_tests_xe_hpg_core.cpp index 972cef9974..495517d0b8 100644 --- a/opencl/test/unit_test/xe_hpg_core/copy_engine_tests_xe_hpg_core.cpp +++ b/opencl/test/unit_test/xe_hpg_core/copy_engine_tests_xe_hpg_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -293,7 +293,7 @@ XE_HPG_CORETEST_F(BlitXeHpgCoreTests, givenBufferWhenProgrammingBltCommandThenSe XE_HPG_CORETEST_F(BlitXeHpgCoreTests, givenBufferWhenProgrammingBltCommandAndRevisionB0ThenSetTargetMemory) { using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT; HardwareInfo *hwInfo = clDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily); + const auto &productHelper = clDevice->getProductHelper(); hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo); auto csr = static_cast *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver); diff --git a/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp b/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp index 098911f6a5..366e14ceea 100644 --- a/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp +++ b/opencl/test/unit_test/xe_hpg_core/dg2/test_cmds_programming_dg2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -153,7 +153,7 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenAlignedCacheableReadOnlyBufferAndDebugge DG2TEST_F(CmdsProgrammingTestsDg2, givenDG2WithBSteppingWhenFlushingTaskThenAdditionalStateBaseAddressCommandIsPresent) { auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily); + const auto &productHelper = pDevice->getProductHelper(); hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo); auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver();