diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 4f5a79e3b8..ec35a43b35 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -140,7 +140,7 @@ std::string ModuleTranslationUnit::generateCompilerOptions(const char *buildOpti internalOptions = NEO::CompilerOptions::concatenate(internalOptions, BuildOptions::debugKernelEnable); } - const auto &compilerProductHelper = *NEO::CompilerProductHelper::get(neoDevice.getHardwareInfo().platform.eProductFamily); + const auto &compilerProductHelper = neoDevice.getRootDeviceEnvironment().getHelper(); auto forceToStatelessRequired = compilerProductHelper.isForceToStatelessRequired(); auto statelessToStatefulOptimizationDisabled = NEO::DebugManager.flags.DisableStatelessToStatefulOptimization.get(); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index fdaf3c5aa5..9f11d0320a 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -2511,7 +2511,7 @@ HWTEST_F(ModuleTranslationUnitTest, givenInternalOptionsThenLSCCachePolicyIsSet) MockModuleTranslationUnit moduleTu(this->device); ze_result_t result = ZE_RESULT_ERROR_MODULE_BUILD_FAILURE; result = moduleTu.buildFromSpirV("", 0U, nullptr, "", nullptr); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = rootDeviceEnvironment->getHelper(); EXPECT_EQ(result, ZE_RESULT_SUCCESS); auto expectedPolicy = compilerProductHelper.getCachingPolicyOptions(false); if (expectedPolicy != nullptr) { @@ -2570,7 +2570,7 @@ HWTEST_F(ModuleTranslationUnitTest, givenForceToStatelessRequiredWhenBuildingMod result = moduleTu.buildFromSpirV("", 0U, nullptr, "", nullptr); EXPECT_EQ(result, ZE_RESULT_SUCCESS); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = rootDeviceEnvironment->getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { EXPECT_NE(mockCompilerInterface->inputInternalOptions.find("cl-intel-greater-than-4GB-buffer-required"), std::string::npos); } else { @@ -3003,7 +3003,7 @@ TEST_F(ModuleInitializeTest, whenModuleInitializeIsCalledThenCorrectResultIsRetu ze_result_t createFromNativeBinary(const char *input, size_t inputSize) override { return ZE_RESULT_SUCCESS; } }; - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = neoDevice->getRootDeviceEnvironment().getHelper(); if (!compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index 82e83524ac..143cabd3dc 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -63,7 +63,7 @@ std::string Program::getInternalOptions() const { } auto &hwInfo = pClDevice->getHardwareInfo(); - const auto &compilerProductHelper = *CompilerProductHelper::get(hwInfo.platform.eProductFamily); + const auto &compilerProductHelper = pClDevice->getRootDeviceEnvironment().getHelper(); auto forceToStatelessRequired = compilerProductHelper.isForceToStatelessRequired(); auto disableStatelessToStatefulOptimization = DebugManager.flags.DisableStatelessToStatefulOptimization.get(); diff --git a/opencl/test/unit_test/built_ins/built_in_tests.cpp b/opencl/test/unit_test/built_ins/built_in_tests.cpp index 96a8df9f9b..c47e0f2f37 100644 --- a/opencl/test/unit_test/built_ins/built_in_tests.cpp +++ b/opencl/test/unit_test/built_ins/built_in_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -169,7 +169,7 @@ INSTANTIATE_TEST_CASE_P(, HWCMDTEST_P(IGFX_XE_HP_CORE, AuxBuiltInTests, givenXeHpCoreCommandsAndAuxTranslationKernelWhenSettingKernelArgsThenSetValidMocs) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } @@ -723,7 +723,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, AuxBuiltInTests, givenAuxTranslationKernelWhenSettin } HWTEST2_P(AuxBuiltInTests, givenAuxToNonAuxTranslationWhenSettingSurfaceStateThenSetValidAuxMode, AuxBuiltinsMatcher) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } @@ -780,7 +780,7 @@ HWTEST2_P(AuxBuiltInTests, givenAuxToNonAuxTranslationWhenSettingSurfaceStateThe } HWTEST2_P(AuxBuiltInTests, givenNonAuxToAuxTranslationWhenSettingSurfaceStateThenSetValidAuxMode, AuxBuiltinsMatcher) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } @@ -1686,7 +1686,7 @@ TEST_F(BuiltInTests, givenCreateProgramFromSourceWhenForceToStatelessRequiredOr3 EXPECT_NE(nullptr, program.get()); auto builtinInternalOptions = program->getInternalOptions(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || is32bit) { EXPECT_TRUE(hasSubstr(builtinInternalOptions, std::string(CompilerOptions::greaterThan4gbBuffersRequired))); } else { @@ -1740,7 +1740,7 @@ TEST_F(BuiltInTests, GivenForce32bitWhenCreatingProgramThenCorrectKernelIsCreate EXPECT_EQ(std::string::npos, it); it = builtinInternalOptions.find(NEO::CompilerOptions::greaterThan4gbBuffersRequired.data()); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (is32bit || compilerProductHelper.isForceToStatelessRequired()) { EXPECT_NE(std::string::npos, it); 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 ee3a6c7543..4745488d67 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -562,7 +562,7 @@ HWTEST_F(EnqueueKernelTest, GivenGpuHangAndBlockingCallWhenEnqueingKernelThenOut } HWTEST_F(EnqueueKernelTest, WhenEnqueingKernelThenIndirectDataIsAdded) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); auto dshBefore = pDSH->getUsed(); auto iohBefore = pIOH->getUsed(); diff --git a/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp index 0e538d8bf6..6cace30d91 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_buffer_rect_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -579,7 +579,7 @@ HWTEST_F(EnqueueReadBufferRectTest, givenInOrderQueueAndDstPtrEqualSrcPtrAndNonZ HWTEST_F(EnqueueReadWriteBufferRectDispatch, givenOffsetResultingInMisalignedPtrWhenEnqueueReadBufferRectForNon3DCaseIsCalledThenAddressInStateBaseAddressIsAlignedAndMatchesKernelDispatchInfoParams) { hwInfo->capabilityTable.blitterOperationsSupported = false; initializeFixture(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp index d8232ce490..3231015c8f 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_buffer_rect_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -580,7 +580,7 @@ HWTEST_F(EnqueueReadWriteBufferRectDispatch, givenOffsetResultingInMisalignedPtr hwInfo->capabilityTable.blitterOperationsSupported = false; initializeFixture(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/gtpin/gtpin_tests.cpp b/opencl/test/unit_test/gtpin/gtpin_tests.cpp index 1cdcdba559..b3009107ac 100644 --- a/opencl/test/unit_test/gtpin/gtpin_tests.cpp +++ b/opencl/test/unit_test/gtpin/gtpin_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -725,7 +725,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenContextIsCreatedThenCorrect TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCallbacksAreCalled) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -881,7 +881,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCa TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelINTELIsExecutedThenGTPinCallbacksAreCalled) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1085,7 +1085,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenK TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenGTPinSubmitKernelCallbackIsNotCalled) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1205,7 +1205,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenG TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenBlockedKernelWithoutSSHIsUsedThenGTPinSubmitKernelCallbackIsNotCalled) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1334,7 +1334,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenBlockedKernelWithoutSSHIsUs TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenTheSameKerneIsExecutedTwiceThenGTPinCreateKernelCallbackIsCalledOnce) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1502,7 +1502,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenTheSameKerneIsExecutedTwice } TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThenOnlyNonNullSurfacesAreMadeResident) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1630,7 +1630,7 @@ TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThe TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKernelSubmitRelatedNotificationsAreCalled) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -1831,7 +1831,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKerne TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenOneKernelIsSubmittedSeveralTimesThenCorrectBuffersAreMadeResident) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -2084,7 +2084,7 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenLowMemoryConditionOccursThe } TEST_F(GTPinTests, givenKernelWithSSHThenVerifyThatSSHResizeWorksWell) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); } @@ -2545,7 +2545,7 @@ HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuf HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBufferIsAllocatedInSharedMemoryThenSetSurfaceStateForTheBufferAndMakeItResident) { GTPinGfxCoreHelper >pinHelper = GTPinGfxCoreHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (!gtpinHelper.canUseSharedAllocation(pDevice->getHardwareInfo()) || compilerProductHelper.isForceToStatelessRequired() || !compilerProductHelper.isStatelessToStatefulBufferOffsetSupported()) { GTEST_SKIP(); diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 4aade5307f..c13dc23049 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -1958,7 +1958,8 @@ class BufferL3CacheTests : public ::testing::TestWithParam { }; HWTEST_P(BufferL3CacheTests, DISABLED_givenMisalignedAndAlignedBufferWhenClEnqueueWriteImageThenL3CacheIsOn) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + auto device = ctx.getDevice(0); + const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || !ctx.getDevice(0)->getHardwareInfo().capabilityTable.supportsImages) { GTEST_SKIP(); } @@ -1995,7 +1996,8 @@ HWTEST_P(BufferL3CacheTests, DISABLED_givenMisalignedAndAlignedBufferWhenClEnque } HWTEST_P(BufferL3CacheTests, givenMisalignedAndAlignedBufferWhenClEnqueueWriteBufferRectThenL3CacheIsOn) { - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + auto device = ctx.getDevice(0); + const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index e076b9e492..27144ad478 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -1091,7 +1091,7 @@ TEST_F(ProgramFromSourceTest, GivenFlagsWhenCompilingProgramThenBuildOptionsHave EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, CompilerOptions::fastRelaxedMath)) << cip->buildOptions; EXPECT_FALSE(CompilerOptions::contains(cip->buildInternalOptions, CompilerOptions::gtpinRera)) << cip->buildInternalOptions; - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (!compilerProductHelper.isForceToStatelessRequired()) { EXPECT_FALSE(CompilerOptions::contains(cip->buildInternalOptions, CompilerOptions::greaterThan4gbBuffersRequired)) << cip->buildInternalOptions; } @@ -1554,7 +1554,7 @@ TEST_F(ProgramTests, GivenStatelessToStatefulIsDisabledWhenProgramIsCreatedThenG TEST_F(ProgramTests, whenGetInternalOptionsThenLSCPolicyIsSet) { MockProgram program(pContext, false, toClDeviceVector(*pClDevice)); auto internalOptions = program.getInternalOptions(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); auto expectedPolicy = compilerProductHelper.getCachingPolicyOptions(false); if (expectedPolicy != nullptr) { EXPECT_TRUE(CompilerOptions::contains(internalOptions, expectedPolicy)); @@ -1615,7 +1615,7 @@ TEST_F(ProgramTests, GivenForce32BitAddressessWhenProgramIsCreatedThenGreaterTha const_cast(&pDevice->getDeviceInfo())->force32BitAddressess = true; MockProgram program(pContext, false, toClDeviceVector(*pClDevice)); auto internalOptions = program.getInternalOptions(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { EXPECT_TRUE(CompilerOptions::contains(internalOptions, CompilerOptions::greaterThan4gbBuffersRequired)) << internalOptions; } else { @@ -1631,7 +1631,7 @@ TEST_F(ProgramTests, Given32bitSupportWhenProgramIsCreatedThenGreaterThan4gbBuff DebugManager.flags.DisableStatelessToStatefulOptimization.set(false); std::unique_ptr program{Program::createBuiltInFromSource("", pContext, pContext->getDevices(), nullptr)}; auto internalOptions = program->getInternalOptions(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired() || is32bit) { EXPECT_TRUE(CompilerOptions::contains(internalOptions, NEO::CompilerOptions::greaterThan4gbBuffersRequired)) << internalOptions; @@ -1660,7 +1660,7 @@ TEST_F(ProgramTests, Force32BitAddressessWhenProgramIsCreatedThenGreaterThan4gbB const_cast(&pDevice->getDeviceInfo())->force32BitAddressess = true; std::unique_ptr program{Program::createBuiltInFromSource("", pContext, pContext->getDevices(), nullptr)}; auto internalOptions = program->getInternalOptions(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); if (is32bit || compilerProductHelper.isForceToStatelessRequired()) { EXPECT_TRUE(CompilerOptions::contains(internalOptions, CompilerOptions::greaterThan4gbBuffersRequired)) << internalOptions; } else { @@ -1694,7 +1694,7 @@ TEST_F(ProgramTests, whenContainsStatefulAccessIsCalledThenReturnCorrectResult) TEST_F(ProgramTests, givenStatefulAndStatelessAccessesWhenProgramBuildIsCalledThenCorrectResultIsReturned) { DebugManagerStateRestore restorer; - const auto &compilerProductHelper = *CompilerProductHelper::get(pClDevice->getHardwareInfo().platform.eProductFamily); + const auto &compilerProductHelper = pDevice->getRootDeviceEnvironment().getHelper(); class MyMockProgram : public Program { public: @@ -3675,4 +3675,4 @@ TEST(ProgramGenerateDefaultArgsMetadataTests, whenGeneratingDefaultMetadataForAr buildInfo.kernelInfoArray.clear(); buildInfo.unpackedDeviceBinary.release(); -} \ No newline at end of file +} diff --git a/opencl/test/unit_test/scenarios/windows/enqueue_read_write_buffer_scenarios_windows_tests.cpp b/opencl/test/unit_test/scenarios/windows/enqueue_read_write_buffer_scenarios_windows_tests.cpp index 341299de6b..ca8f8bd3c2 100644 --- a/opencl/test/unit_test/scenarios/windows/enqueue_read_write_buffer_scenarios_windows_tests.cpp +++ b/opencl/test/unit_test/scenarios/windows/enqueue_read_write_buffer_scenarios_windows_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -82,7 +82,7 @@ HWTEST_F(EnqueueBufferWindowsTest, givenMisalignedHostPtrWhenEnqueueReadBufferCa GTEST_SKIP(); } initializeFixture(); - const auto &compilerProductHelper = *CompilerProductHelper::get(defaultHwInfo->platform.eProductFamily); + const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); } diff --git a/shared/source/execution_environment/root_device_environment.cpp b/shared/source/execution_environment/root_device_environment.cpp index f545d5ddea..7905ad1ce3 100644 --- a/shared/source/execution_environment/root_device_environment.cpp +++ b/shared/source/execution_environment/root_device_environment.cpp @@ -20,6 +20,7 @@ #include "shared/source/gmm_helper/page_table_mngr.h" #include "shared/source/helpers/api_specific_config.h" #include "shared/source/helpers/bindless_heaps_helper.h" +#include "shared/source/helpers/compiler_hw_info_config.h" #include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/memory_manager/memory_manager.h" @@ -170,17 +171,21 @@ bool RootDeviceEnvironment::isNumberOfCcsLimited() const { template HelperType &RootDeviceEnvironment::getHelper() const { - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { + auto &compilerProductHelper = *CompilerProductHelper::get(this->getHardwareInfo()->platform.eProductFamily); + return compilerProductHelper; + } else if constexpr (std::is_same_v) { auto &productHelper = *ProductHelper::get(this->getHardwareInfo()->platform.eProductFamily); return productHelper; } else { - static_assert(std::is_same_v, "Only ProductHelper and GfxCoreHelper are supported"); + static_assert(std::is_same_v, "Only CompilerProductHelper, ProductHelper and GfxCoreHelper are supported"); auto &gfxCoreHelper = GfxCoreHelper::get(this->getHardwareInfo()->platform.eRenderCoreFamily); return gfxCoreHelper; } } template ProductHelper &RootDeviceEnvironment::getHelper() const; +template CompilerProductHelper &RootDeviceEnvironment::getHelper() const; template GfxCoreHelper &RootDeviceEnvironment::getHelper() const; } // namespace NEO diff --git a/shared/test/unit_test/command_stream/get_devices_tests.cpp b/shared/test/unit_test/command_stream/get_devices_tests.cpp index 75ee7b4867..566c554cbc 100644 --- a/shared/test/unit_test/command_stream/get_devices_tests.cpp +++ b/shared/test/unit_test/command_stream/get_devices_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -260,7 +260,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsS hardwareInfoSetup[expectedHwInfo.platform.eProductFamily](&expectedHwInfo, true, 0x0); productHelper.configureHardwareCustom(&expectedHwInfo, nullptr); - const auto &compilerProductHelper = *NEO::CompilerProductHelper::get(expectedHwInfo.platform.eProductFamily); + const auto &compilerProductHelper = exeEnv.rootDeviceEnvironments[i]->getHelper(); compilerProductHelper.setProductConfigForHwInfo(expectedHwInfo, deviceAot.aotConfig); expectedHwInfo.platform.usDeviceID = deviceAot.deviceIds->front();