From f2bbb56d297a876454eb18a83abc9b25ed9d3d86 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Mon, 9 Jan 2023 15:56:36 +0000 Subject: [PATCH] refactor: don't use global GfxCoreHelper getter 2/n Related-To: NEO-6853 Signed-off-by: Kamil Kopryk --- .../helpers/hardware_commands_helper_base.inl | 5 +- .../command_container/command_encoder.h | 2 +- .../command_encoder_bdw_and_later.inl | 5 +- .../command_encoder_xehp_and_later.inl | 6 +- shared/source/gen8/hw_helper_gen8.cpp | 6 +- shared/source/helpers/hw_helper.h | 8 +- shared/source/helpers/hw_helper_base.inl | 4 +- .../command_encoder_xe_hpc_core.cpp | 9 ++- .../xe_hpc_core/hw_helper_xe_hpc_core.cpp | 6 +- .../command_encoder_xe_hpg_core.cpp | 7 +- .../xe_hpg_core/hw_helper_xe_hpg_core.cpp | 2 +- .../encoders/test_encode_dispatch_kernel.cpp | 6 +- ...t_encode_dispatch_kernel_dg2_and_later.cpp | 6 +- ...est_encode_dispatch_kernel_dg2_and_later.h | 8 +- ...t_encode_dispatch_kernel_pvc_and_later.cpp | 4 +- ..._encode_dispatch_kernel_xehp_and_later.cpp | 5 +- .../unit_test/helpers/hw_helper_tests.cpp | 74 +++++++++---------- .../pvc/test_encode_dispatch_kernel_pvc.cpp | 9 ++- .../dg2/test_encode_dispatch_kernel_dg2.cpp | 32 +++++--- .../xe_hpg_core/mtl/hw_helper_tests_mtl.cpp | 4 +- 20 files changed, 115 insertions(+), 93 deletions(-) diff --git a/opencl/source/helpers/hardware_commands_helper_base.inl b/opencl/source/helpers/hardware_commands_helper_base.inl index 847a2c691a..d8eb0dd482 100644 --- a/opencl/source/helpers/hardware_commands_helper_base.inl +++ b/opencl/source/helpers/hardware_commands_helper_base.inl @@ -148,7 +148,7 @@ size_t HardwareCommandsHelper::sendInterfaceDescriptorData( productHelper.updateIddCommand(&interfaceDescriptor, kernelDescriptor.kernelAttributes.numGrfRequired, kernelDescriptor.kernelAttributes.threadArbitrationPolicy); - EncodeDispatchKernel::appendAdditionalIDDFields(&interfaceDescriptor, hardwareInfo, threadsPerThreadGroup, + EncodeDispatchKernel::appendAdditionalIDDFields(&interfaceDescriptor, device.getRootDeviceEnvironment(), threadsPerThreadGroup, slmTotalSize, SlmPolicy::SlmPolicyNone); interfaceDescriptor.setBindingTablePointer(static_cast(bindingTablePointer)); @@ -161,8 +161,9 @@ size_t HardwareCommandsHelper::sendInterfaceDescriptorData( EncodeDispatchKernel::adjustBindingTablePrefetch(interfaceDescriptor, numSamplers, bindingTablePrefetchSize); + auto &gfxCoreHelper = device.getGfxCoreHelper(); auto programmableIDSLMSize = - static_cast(GfxCoreHelperHw::get().computeSlmValues(hardwareInfo, slmTotalSize)); + static_cast(gfxCoreHelper.computeSlmValues(hardwareInfo, slmTotalSize)); if (DebugManager.flags.OverrideSlmAllocationSize.get() != -1) { programmableIDSLMSize = static_cast(DebugManager.flags.OverrideSlmAllocationSize.get()); diff --git a/shared/source/command_container/command_encoder.h b/shared/source/command_container/command_encoder.h index ea094d2234..dd768e80ca 100644 --- a/shared/source/command_container/command_encoder.h +++ b/shared/source/command_container/command_encoder.h @@ -87,7 +87,7 @@ struct EncodeDispatchKernel { static void encodeAdditionalWalkerFields(const HardwareInfo &hwInfo, WALKER_TYPE &walkerCmd, const EncodeWalkerArgs &walkerArgs); - static void appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const HardwareInfo &hwInfo, + static void appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy); static void setGrfInfo(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, uint32_t numGrf, const size_t &sizeCrossThreadData, diff --git a/shared/source/command_container/command_encoder_bdw_and_later.inl b/shared/source/command_container/command_encoder_bdw_and_later.inl index ee8903d481..ada536acd5 100644 --- a/shared/source/command_container/command_encoder_bdw_and_later.inl +++ b/shared/source/command_container/command_encoder_bdw_and_later.inl @@ -56,6 +56,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto pImplicitArgs = args.dispatchInterface->getImplicitArgs(); const HardwareInfo &hwInfo = args.device->getHardwareInfo(); + auto &gfxCoreHelper = args.device->getGfxCoreHelper(); LinearStream *listCmdBufferStream = container.getCommandStream(); @@ -84,7 +85,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis kernelDescriptor.kernelAttributes.barrierCount, hwInfo); auto slmSize = static_cast( - GfxCoreHelperHw::get().computeSlmValues(hwInfo, args.dispatchInterface->getSlmTotalSize())); + gfxCoreHelper.computeSlmValues(hwInfo, args.dispatchInterface->getSlmTotalSize())); idd.setSharedLocalMemorySize(slmSize); uint32_t bindingTableStateCount = kernelDescriptor.payloadMappings.bindingTable.numEntries; @@ -375,7 +376,7 @@ template inline void EncodeDispatchKernel::encodeAdditionalWalkerFields(const HardwareInfo &hwInfo, WALKER_TYPE &walkerCmd, const EncodeWalkerArgs &walkerArgs) {} template -void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const HardwareInfo &hwInfo, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) {} +void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) {} template inline void EncodeComputeMode::adjustPipelineSelect(CommandContainer &container, const NEO::KernelDescriptor &kernelDescriptor) { diff --git a/shared/source/command_container/command_encoder_xehp_and_later.inl b/shared/source/command_container/command_encoder_xehp_and_later.inl index 081e7be9c4..257bb7ee94 100644 --- a/shared/source/command_container/command_encoder_xehp_and_later.inl +++ b/shared/source/command_container/command_encoder_xehp_and_later.inl @@ -102,8 +102,10 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis kernelDescriptor.kernelAttributes.barrierCount, hwInfo); + auto &gfxCoreHelper = args.device->getGfxCoreHelper(); + auto slmSize = static_cast( - GfxCoreHelperHw::get().computeSlmValues(hwInfo, args.dispatchInterface->getSlmTotalSize())); + gfxCoreHelper.computeSlmValues(hwInfo, args.dispatchInterface->getSlmTotalSize())); if (DebugManager.flags.OverrideSlmAllocationSize.get() != -1) { slmSize = static_cast(DebugManager.flags.OverrideSlmAllocationSize.get()); @@ -291,7 +293,7 @@ void EncodeDispatchKernel::encode(CommandContainer &container, EncodeDis auto threadGroupCount = walkerCmd.getThreadGroupIdXDimension() * walkerCmd.getThreadGroupIdYDimension() * walkerCmd.getThreadGroupIdZDimension(); EncodeDispatchKernel::adjustInterfaceDescriptorData(idd, *args.device, hwInfo, threadGroupCount, kernelDescriptor.kernelAttributes.numGrfRequired); - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsPerThreadGroup, + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, args.device->getRootDeviceEnvironment(), threadsPerThreadGroup, args.dispatchInterface->getSlmTotalSize(), args.dispatchInterface->getSlmPolicy()); diff --git a/shared/source/gen8/hw_helper_gen8.cpp b/shared/source/gen8/hw_helper_gen8.cpp index 85fff113df..2f294f7932 100644 --- a/shared/source/gen8/hw_helper_gen8.cpp +++ b/shared/source/gen8/hw_helper_gen8.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ typedef Gen8Family Family; static uint32_t slmSizeId[] = {0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16}; template <> -uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { +uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) const { if (slmSize == 0u) { return 0u; } @@ -30,7 +30,7 @@ uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { } template <> -uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) { +uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const { slmSize += (4 * KB - 1); slmSize = slmSize >> 12; slmSize = std::min(slmSize, 15u); diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 5448674a68..18a7f42c36 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -91,8 +91,8 @@ class GfxCoreHelper { virtual bool isLinearStoragePreferred(bool isSharedContext, bool isImage1d, bool forceLinearStorage) const = 0; virtual uint8_t getBarriersCountFromHasBarriers(uint8_t hasBarriers) const = 0; virtual uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const = 0; - virtual uint32_t alignSlmSize(uint32_t slmSize) = 0; - virtual uint32_t computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) = 0; + virtual uint32_t alignSlmSize(uint32_t slmSize) const = 0; + virtual uint32_t computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const = 0; virtual bool isWaDisableRccRhwoOptimizationRequired() const = 0; virtual bool isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const = 0; @@ -270,9 +270,9 @@ class GfxCoreHelperHw : public GfxCoreHelper { uint32_t calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const override; - uint32_t alignSlmSize(uint32_t slmSize) override; + uint32_t alignSlmSize(uint32_t slmSize) const override; - uint32_t computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) override; + uint32_t computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const override; static AuxTranslationMode getAuxTranslationMode(const HardwareInfo &hwInfo); diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 2d898c3b25..280eb8df33 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -418,7 +418,7 @@ bool GfxCoreHelperHw::isLinearStoragePreferred(bool isSharedContext, } template -uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { +uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) const { if (slmSize == 0u) { return 0u; } @@ -429,7 +429,7 @@ uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { } template -uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) { +uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const { auto value = std::max(slmSize, 1024u); value = Math::nextPowerOfTwo(value); value = Math::getMinLsbSet(value); diff --git a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp index ca533cdfbf..8f213e02ce 100644 --- a/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/command_encoder_xe_hpc_core.cpp @@ -251,12 +251,15 @@ void EncodeDispatchKernel::encodeAdditionalWalkerFields(const HardwareIn } template <> -void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const HardwareInfo &hwInfo, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) { +void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) { using PREFERRED_SLM_ALLOCATION_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - + auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); const uint32_t threadsPerDssCount = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.DualSubSliceCount; const uint32_t workGroupCountPerDss = static_cast(Math::divideAndRoundUp(threadsPerDssCount, threadsPerThreadGroup)); - const uint32_t workgroupSlmSize = GfxCoreHelperHw::get().alignSlmSize(slmTotalSize); + + auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); + + const uint32_t workgroupSlmSize = gfxCoreHelper.alignSlmSize(slmTotalSize); uint32_t slmSize = 0u; diff --git a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp index 4edca327de..3e9f746042 100644 --- a/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/hw_helper_xe_hpc_core.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -283,7 +283,7 @@ std::string GfxCoreHelperHw::getExtensions(const HardwareInfo &hwInfo) c } template <> -uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { +uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) const { const uint32_t alignedSlmSizes[] = { 0u, 1u * KB, @@ -310,7 +310,7 @@ uint32_t GfxCoreHelperHw::alignSlmSize(uint32_t slmSize) { } template <> -uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) { +uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const { using SHARED_LOCAL_MEMORY_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE; if (slmSize == 0u) { return SHARED_LOCAL_MEMORY_SIZE::SHARED_LOCAL_MEMORY_SIZE_ENCODES_0K; diff --git a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp index 18bd8fd746..5cb891073b 100644 --- a/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/command_encoder_xe_hpg_core.cpp @@ -32,12 +32,13 @@ void EncodeDispatchKernel::adjustTimestampPacket(WALKER_TYPE &walkerCmd, } template <> -void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const HardwareInfo &hwInfo, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) { +void EncodeDispatchKernel::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const RootDeviceEnvironment &rootDeviceEnvironment, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) { using PREFERRED_SLM_ALLOCATION_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - + auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); const uint32_t threadsPerDssCount = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.DualSubSliceCount; const uint32_t workGroupCountPerDss = threadsPerDssCount / threadsPerThreadGroup; - const uint32_t workgroupSlmSize = GfxCoreHelperHw::get().alignSlmSize(slmTotalSize); + auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); + const uint32_t workgroupSlmSize = gfxCoreHelper.alignSlmSize(slmTotalSize); uint32_t slmSize = 0u; diff --git a/shared/source/xe_hpg_core/hw_helper_xe_hpg_core.cpp b/shared/source/xe_hpg_core/hw_helper_xe_hpg_core.cpp index 81d26d1912..95207eb2fe 100644 --- a/shared/source/xe_hpg_core/hw_helper_xe_hpg_core.cpp +++ b/shared/source/xe_hpg_core/hw_helper_xe_hpg_core.cpp @@ -126,7 +126,7 @@ bool GfxCoreHelperHw::isBufferSizeSuitableForCompression(const size_t si } template <> -uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) { +uint32_t GfxCoreHelperHw::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) const { using SHARED_LOCAL_MEMORY_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE; auto slmValue = std::max(slmSize, 1024u); diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp index 20e91ba1de..52b02e8336 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -250,9 +250,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterThan EncodeDispatchKernel::encode(*cmdContainer.get(), dispatchArgs, nullptr); auto interfaceDescriptorData = static_cast(cmdContainer->getIddBlock()); - + auto &gfxcoreHelper = this->getHelper(); uint32_t expectedValue = static_cast( - GfxCoreHelperHw::get().computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize)); + gfxcoreHelper.computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize)); EXPECT_EQ(expectedValue, interfaceDescriptorData->getSharedLocalMemorySize()); } diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.cpp index caff77c260..702f62a633 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.cpp @@ -97,9 +97,9 @@ HWTEST2_F(CommandEncodeStatesTestDg2AndLater, GivenVariousSlmTotalSizesAndSettin for (auto rev : revs) { hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(rev, hwInfo); if ((hwInfo.platform.eProductFamily == IGFX_DG2) && (rev == REVISION_A0)) { - verifyPreferredSlmValues(valuesToTestForDg2AStep, hwInfo); + verifyPreferredSlmValues(valuesToTestForDg2AStep, pDevice->getRootDeviceEnvironment()); } else { - verifyPreferredSlmValues(valuesToTest, hwInfo); + verifyPreferredSlmValues(valuesToTest, pDevice->getRootDeviceEnvironment()); } } } @@ -119,7 +119,7 @@ HWTEST2_F(CommandEncodeStatesTestDg2AndLater, GivenDebugOverrideWhenSetAdditiona {32 * KB, debugOverrideValue}, {64 * KB, debugOverrideValue}, }; - verifyPreferredSlmValues(valuesToTest, hardwareInfo); + verifyPreferredSlmValues(valuesToTest, pDevice->getRootDeviceEnvironment()); } } diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.h b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.h index 333c525bff..92384e81b5 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.h +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_dg2_and_later.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,6 +8,7 @@ #pragma once #include "shared/source/command_container/command_encoder.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/kernel/dispatch_kernel_encoder_interface.h" #include "shared/test/common/test_macros/test.h" @@ -19,10 +20,11 @@ struct PreferredSlmTestValues { }; template -void verifyPreferredSlmValues(std::vector> valuesToTest, NEO::HardwareInfo &hwInfo) { +void verifyPreferredSlmValues(std::vector> valuesToTest, const NEO::RootDeviceEnvironment &rootDeviceEnvironment) { using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA; using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; + auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); auto threadsPerDssCount = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.SubSliceCount; uint32_t localWorkGroupsPerDssCounts[] = {1, 2, 4}; @@ -43,7 +45,7 @@ void verifyPreferredSlmValues(std::vector> va : valueToTest.preferredSlmAllocationSizePerDss / localWorkGroupsPerDssCount; NEO::EncodeDispatchKernel::appendAdditionalIDDFields(&idd, - hwInfo, + rootDeviceEnvironment, threadsPerThreadGroup, slmTotalSize, slmPolicy); diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp index 82491ec607..666b567a7d 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_pvc_and_later.cpp @@ -124,9 +124,9 @@ HWTEST2_F(CommandEncodeStatesTestHpc, GivenVariousSlmTotalSizesAndSettingRevIDTo for (auto rev : revs) { hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(rev, hwInfo); if ((hwInfo.platform.eProductFamily == IGFX_PVC) && (rev == REVISION_A0)) { - verifyPreferredSlmValues(valuesToTestForPvcAStep, hwInfo); + verifyPreferredSlmValues(valuesToTestForPvcAStep, pDevice->getRootDeviceEnvironment()); } else { - verifyPreferredSlmValues(valuesToTest, hwInfo); + verifyPreferredSlmValues(valuesToTest, pDevice->getRootDeviceEnvironment()); } } } diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index 2ae6223953..81849614b6 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -52,9 +52,10 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterTha auto cmd = genCmdCast(*itor); auto &idd = cmd->getInterfaceDescriptor(); + auto &gfxcoreHelper = this->getHelper(); uint32_t expectedValue = static_cast( - GfxCoreHelperHw::get().computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize)); + gfxcoreHelper.computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize)); EXPECT_EQ(expectedValue, idd.getSharedLocalMemorySize()); } diff --git a/shared/test/unit_test/helpers/hw_helper_tests.cpp b/shared/test/unit_test/helpers/hw_helper_tests.cpp index 6bdfc24dbd..9d8c14c1c7 100644 --- a/shared/test/unit_test/helpers/hw_helper_tests.cpp +++ b/shared/test/unit_test/helpers/hw_helper_tests.cpp @@ -1076,51 +1076,51 @@ HWCMDTEST_F(IGFX_GEN8_CORE, GfxCoreHelperTest, GivenVariousValuesWhenAlignSlmSiz HWCMDTEST_F(IGFX_GEN8_CORE, GfxCoreHelperTest, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) { auto hwInfo = *defaultHwInfo; - + auto &gfxCoreHelper = getHelper(); if (::renderCoreFamily == IGFX_GEN8_CORE) { - EXPECT_EQ(0u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 0)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1024)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1025)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 2048)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 2049)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 4096)); - EXPECT_EQ(2u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 4097)); - EXPECT_EQ(2u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 8192)); - EXPECT_EQ(4u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 8193)); - EXPECT_EQ(4u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 12288)); - EXPECT_EQ(4u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 16384)); - EXPECT_EQ(8u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 16385)); - EXPECT_EQ(8u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 24576)); - EXPECT_EQ(8u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 32768)); - EXPECT_EQ(16u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 32769)); - EXPECT_EQ(16u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 49152)); - EXPECT_EQ(16u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 65535)); - EXPECT_EQ(16u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 65536)); + EXPECT_EQ(0u, gfxCoreHelper.computeSlmValues(hwInfo, 0)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1024)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1025)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 2048)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 2049)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 4096)); + EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 4097)); + EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 8192)); + EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 8193)); + EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 12288)); + EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 16384)); + EXPECT_EQ(8u, gfxCoreHelper.computeSlmValues(hwInfo, 16385)); + EXPECT_EQ(8u, gfxCoreHelper.computeSlmValues(hwInfo, 24576)); + EXPECT_EQ(8u, gfxCoreHelper.computeSlmValues(hwInfo, 32768)); + EXPECT_EQ(16u, gfxCoreHelper.computeSlmValues(hwInfo, 32769)); + EXPECT_EQ(16u, gfxCoreHelper.computeSlmValues(hwInfo, 49152)); + EXPECT_EQ(16u, gfxCoreHelper.computeSlmValues(hwInfo, 65535)); + EXPECT_EQ(16u, gfxCoreHelper.computeSlmValues(hwInfo, 65536)); } else { - EXPECT_EQ(0u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 0)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1)); - EXPECT_EQ(1u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1024)); - EXPECT_EQ(2u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 1025)); - EXPECT_EQ(2u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 2048)); - EXPECT_EQ(3u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 2049)); - EXPECT_EQ(3u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 4096)); - EXPECT_EQ(4u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 4097)); - EXPECT_EQ(4u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 8192)); - EXPECT_EQ(5u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 8193)); - EXPECT_EQ(5u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 16384)); - EXPECT_EQ(6u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 16385)); - EXPECT_EQ(6u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 32768)); - EXPECT_EQ(7u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 32769)); - EXPECT_EQ(7u, GfxCoreHelperHw::get().computeSlmValues(hwInfo, 65536)); + EXPECT_EQ(0u, gfxCoreHelper.computeSlmValues(hwInfo, 0)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1)); + EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1024)); + EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 1025)); + EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 2048)); + EXPECT_EQ(3u, gfxCoreHelper.computeSlmValues(hwInfo, 2049)); + EXPECT_EQ(3u, gfxCoreHelper.computeSlmValues(hwInfo, 4096)); + EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 4097)); + EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 8192)); + EXPECT_EQ(5u, gfxCoreHelper.computeSlmValues(hwInfo, 8193)); + EXPECT_EQ(5u, gfxCoreHelper.computeSlmValues(hwInfo, 16384)); + EXPECT_EQ(6u, gfxCoreHelper.computeSlmValues(hwInfo, 16385)); + EXPECT_EQ(6u, gfxCoreHelper.computeSlmValues(hwInfo, 32768)); + EXPECT_EQ(7u, gfxCoreHelper.computeSlmValues(hwInfo, 32769)); + EXPECT_EQ(7u, gfxCoreHelper.computeSlmValues(hwInfo, 65536)); } } HWTEST_F(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) { using SHARED_LOCAL_MEMORY_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE; auto hwInfo = *defaultHwInfo; - - auto receivedSlmSize = static_cast(GfxCoreHelperHw::get().computeSlmValues(hwInfo, 0)); + auto &gfxCoreHelper = getHelper(); + auto receivedSlmSize = static_cast(gfxCoreHelper.computeSlmValues(hwInfo, 0)); EXPECT_EQ(SHARED_LOCAL_MEMORY_SIZE::SHARED_LOCAL_MEMORY_SIZE_ENCODES_0K, receivedSlmSize); } diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp index 7d755487ea..1fd7317338 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_encode_dispatch_kernel_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,6 +9,7 @@ #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/helpers/default_hw_info.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/test.h" #include "shared/test/unit_test/fixtures/command_container_fixture.h" #include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h" @@ -21,7 +22,9 @@ PVCTEST_F(CommandEncodeStatesPvcTest, GivenSmallSlmTotalSizesWhenSetAdditionalIn using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA; using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - HardwareInfo hwInfo = *defaultHwInfo; + MockExecutionEnvironment mockExecutionEnvironment{}; + auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0]; + auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); uint32_t threadsCount = 1; uint32_t slmTotalSize = 0; @@ -42,7 +45,7 @@ PVCTEST_F(CommandEncodeStatesPvcTest, GivenSmallSlmTotalSizesWhenSetAdditionalIn hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = revisionToTest.revisionId; INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, rootDeviceEnvironment, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); if (revisionToTest.isWaRequired) { EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K, idd.getPreferredSlmAllocationSize()); } else { diff --git a/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dispatch_kernel_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dispatch_kernel_dg2.cpp index 3a433df9b6..b01a5be32b 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dispatch_kernel_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dispatch_kernel_dg2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,6 +12,7 @@ #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" @@ -22,21 +23,24 @@ using CommandEncodeStatesDg2Test = ::testing::Test; DG2TEST_F(CommandEncodeStatesDg2Test, GivenSmallSlmTotalSizesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet) { using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA; using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; + MockExecutionEnvironment mockExecutionEnvironment{}; + auto &rootDeviceEnvironment = mockExecutionEnvironment.rootDeviceEnvironments[0]; - VariableBackup revisionId(&defaultHwInfo->platform.usRevId); + auto hwInfo = rootDeviceEnvironment->getMutableHardwareInfo(); + auto &revisionId = hwInfo->platform.usRevId; uint32_t threadsCount = 1; uint32_t slmTotalSize = 0; { - revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_A0, *defaultHwInfo); + revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_A0, *hwInfo); INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *defaultHwInfo, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K, idd.getPreferredSlmAllocationSize()); } { - revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, *defaultHwInfo); + revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, *hwInfo); INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *defaultHwInfo, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K, idd.getPreferredSlmAllocationSize()); } } @@ -45,8 +49,12 @@ DG2TEST_F(CommandEncodeStatesDg2Test, givenNoWorkaroundNeededWhenSelectingPrefer using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA; using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, *defaultHwInfo); + MockExecutionEnvironment mockExecutionEnvironment{}; + auto &rootDeviceEnvironment = mockExecutionEnvironment.rootDeviceEnvironments[0]; + + auto &hwInfo = *rootDeviceEnvironment->getMutableHardwareInfo(); + + hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo); hwInfo.gtSystemInfo.ThreadCount = 1024; hwInfo.gtSystemInfo.DualSubSliceCount = 8; hwInfo.gtSystemInfo.SubSliceCount = 2 * hwInfo.gtSystemInfo.DualSubSliceCount; @@ -55,28 +63,28 @@ DG2TEST_F(CommandEncodeStatesDg2Test, givenNoWorkaroundNeededWhenSelectingPrefer const uint32_t threadsPerThreadGroup = 7; // 18 groups will fit in one DSS const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte; INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K, idd.getPreferredSlmAllocationSize()); } { const uint32_t threadsPerThreadGroup = 8; // 16 groups will fit in one DSS const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte; INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize()); } { const uint32_t threadsPerThreadGroup = 9; // 14 groups will fit in one DSS const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte; INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize()); } { const uint32_t threadsPerThreadGroup = 50; // 2 groups will fit in one DSS const uint32_t slmSizePerThreadGroup = 16 * MemoryConstants::kiloByte; INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData; - EncodeDispatchKernel::appendAdditionalIDDFields(&idd, hwInfo, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); + EncodeDispatchKernel::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm); EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize()); } } diff --git a/shared/test/unit_test/xe_hpg_core/mtl/hw_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/hw_helper_tests_mtl.cpp index f963f60733..fdd957b4ed 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/hw_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/hw_helper_tests_mtl.cpp @@ -144,8 +144,8 @@ MTLTEST_F(GfxCoreHelperTestMtl, givenMtlWhenSetForceNonCoherentThenNothingChange MTLTEST_F(GfxCoreHelperTestMtl, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) { auto hardwareInfo = *defaultHwInfo; - + auto &gfxCoreHelper = getHelper(); for (auto &testInput : computeSlmValuesXeHPAndLaterTestsInput) { - EXPECT_EQ(testInput.expected, GfxCoreHelperHw::get().computeSlmValues(hardwareInfo, testInput.slmSize)); + EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hardwareInfo, testInput.slmSize)); } }