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 97270e72f1..7ecc31b2ee 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -348,7 +348,18 @@ TEST_F(GmmTests, givenNonZeroRowPitchWhenQueryImgFromBufferParamsThenUseUserValu EXPECT_EQ(imgInfo.rowPitch, expectedRowPitch); } -TEST_F(GmmTests, WhenCanonizingThenCorrectAddressIsReturned) { +struct GmmTestsCanonize : public GmmTests { + void SetUp() override { + uint32_t addressWidth = 48u; + HwHelper::get(renderCoreFamily).adjustAddressWidthForCanonize(addressWidth); + if (addressWidth != 48u) { + GTEST_SKIP(); + } + GmmTests::SetUp(); + } +}; + +TEST_F(GmmTestsCanonize, WhenCanonizingThenCorrectAddressIsReturned) { auto hwInfo = *defaultHwInfo; // 48 bit - canonize to 48 bit @@ -371,7 +382,7 @@ TEST_F(GmmTests, WhenCanonizingThenCorrectAddressIsReturned) { EXPECT_EQ(GmmHelper::canonize(testAddr2), goodAddr2); } -TEST_F(GmmTests, WhenDecanonizingThenCorrectAddressIsReturned) { +TEST_F(GmmTestsCanonize, WhenDecanonizingThenCorrectAddressIsReturned) { auto hwInfo = *defaultHwInfo; // 48 bit - decanonize to 48 bit diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 7a851a9562..a4e7112a54 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1051,6 +1051,14 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenRet EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); } +HWTEST_F(HwHelperTest, givenHwHelperWhenAdjustAddressWidthForCanonizeThenAddressWidthDoesntChange) { + HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily); + uint32_t addressWidth = 48; + + hwHelper.adjustAddressWidthForCanonize(addressWidth); + EXPECT_EQ(48u, addressWidth); +} + HWTEST2_F(HwInfoConfigCommonTest, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenHonorTheFlag, IsAtLeastGen12lp) { DebugManagerStateRestore restore{}; HardwareInfo hardwareInfo = *defaultHwInfo; diff --git a/shared/source/gmm_helper/gmm_helper.cpp b/shared/source/gmm_helper/gmm_helper.cpp index d6c0f7966e..0cfb979431 100644 --- a/shared/source/gmm_helper/gmm_helper.cpp +++ b/shared/source/gmm_helper/gmm_helper.cpp @@ -8,6 +8,7 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/debug_helpers.h" +#include "shared/source/helpers/hw_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/os_interface/os_library.h" @@ -37,7 +38,9 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const { GmmHelper::GmmHelper(OSInterface *osInterface, const HardwareInfo *pHwInfo) : hwInfo(pHwInfo) { auto hwInfoAddressWidth = Math::log2(hwInfo->capabilityTable.gpuAddressSpace + 1); + HwHelper::get(hwInfo->platform.eRenderCoreFamily).adjustAddressWidthForCanonize(hwInfoAddressWidth); GmmHelper::addressWidth = std::max(hwInfoAddressWidth, static_cast(48)); + gmmClientContext = GmmHelper::createGmmContextWrapperFunc(osInterface, const_cast(pHwInfo)); UNRECOVERABLE_IF(!gmmClientContext); } diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 727128a96a..3cd1dec5ca 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -124,6 +124,7 @@ class HwHelper { virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0; virtual bool isMediaBlockIOSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isCopyOnlyEngineType(EngineGroupType type) const = 0; + virtual void adjustAddressWidthForCanonize(uint32_t &addressWidth) const = 0; static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo); static uint32_t getEnginesCount(const HardwareInfo &hwInfo); @@ -314,6 +315,8 @@ class HwHelperHw : public HwHelper { bool isCopyOnlyEngineType(EngineGroupType type) const override; + void adjustAddressWidthForCanonize(uint32_t &addressWidth) const override; + protected: LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 8d3e0282ef..b03448d11e 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -510,4 +510,8 @@ bool HwHelperHw::isCopyOnlyEngineType(EngineGroupType type) const { return NEO::EngineGroupType::Copy == type; } +template +void HwHelperHw::adjustAddressWidthForCanonize(uint32_t &addressWidth) const { +} + } // namespace NEO