From d35f4249cd59c387259b0991c168c1573501f6dd Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Tue, 20 Dec 2022 13:22:42 +0000 Subject: [PATCH] Use static isWorkaroundRequired in isOffsetToSkipSetFFIDGPWARequired function Related-To: NEO-6853 Signed-off-by: Kamil Kopryk --- opencl/source/cl_device/cl_device.cpp | 4 ++++ opencl/source/cl_device/cl_device.h | 2 ++ opencl/source/kernel/kernel.cpp | 5 +++-- shared/source/gen12lp/hw_helper_gen12lp.cpp | 4 ++-- shared/source/helpers/hw_helper.h | 4 ++-- shared/source/helpers/hw_helper_base.inl | 2 +- shared/test/unit_test/helpers/hw_helper_tests.cpp | 5 +++-- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/opencl/source/cl_device/cl_device.cpp b/opencl/source/cl_device/cl_device.cpp index 2e57861ec7..f525d4481b 100644 --- a/opencl/source/cl_device/cl_device.cpp +++ b/opencl/source/cl_device/cl_device.cpp @@ -272,4 +272,8 @@ const GfxCoreHelper &ClDevice::getGfxCoreHelper() const { return device.getGfxCoreHelper(); } +const ProductHelper &ClDevice::getProductHelper() const { + return device.getProductHelper(); +} + } // namespace NEO diff --git a/opencl/source/cl_device/cl_device.h b/opencl/source/cl_device/cl_device.h index a3eea9f351..9c1fb65f7f 100644 --- a/opencl/source/cl_device/cl_device.h +++ b/opencl/source/cl_device/cl_device.h @@ -38,6 +38,7 @@ struct HardwareInfo; struct RootDeviceEnvironment; struct SelectorCopyEngine; class GfxCoreHelper; +class ProductHelper; template <> struct OpenCLObjectMapper<_cl_device_id> { @@ -127,6 +128,7 @@ class ClDevice : public BaseObject<_cl_device_id> { void getQueueFamilyName(char *outputName, EngineGroupType type); Platform *getPlatform() const; const GfxCoreHelper &getGfxCoreHelper() const; + const ProductHelper &getProductHelper() const; protected: void initializeCaps(); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index eef2a936d5..3bd12a89ca 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -2087,9 +2087,10 @@ uint64_t Kernel::getKernelStartAddress(const bool localIdsGenerationByRuntime, c kernelStartOffset += getStartOffset(); auto &hardwareInfo = getHardwareInfo(); - auto &gfxCoreHelper = getDevice().getGfxCoreHelper(); + const auto &gfxCoreHelper = getDevice().getGfxCoreHelper(); + const auto &productHelper = getDevice().getProductHelper(); - if (isCssUsed && gfxCoreHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo)) { + if (isCssUsed && gfxCoreHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo, productHelper)) { kernelStartOffset += kernelInfo.kernelDescriptor.entryPoints.skipSetFFIDGP; } diff --git a/shared/source/gen12lp/hw_helper_gen12lp.cpp b/shared/source/gen12lp/hw_helper_gen12lp.cpp index a500e36dd1..8715639a39 100644 --- a/shared/source/gen12lp/hw_helper_gen12lp.cpp +++ b/shared/source/gen12lp/hw_helper_gen12lp.cpp @@ -39,8 +39,8 @@ size_t GfxCoreHelperHw::getMax3dImageWidthOrHeight() const { } template <> -bool GfxCoreHelperHw::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const { - return isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo); +bool GfxCoreHelperHw::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const { + return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, productHelper); } template <> diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index e0c5b6ce23..a5e879066d 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -98,7 +98,7 @@ class GfxCoreHelper { virtual bool isAdditionalFeatureFlagRequired(const FeatureTable *featureTable) const = 0; virtual uint32_t getMinimalSIMDSize() const = 0; virtual bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const = 0; - virtual bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const = 0; + virtual bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const = 0; virtual bool isFusedEuDispatchEnabled(const HardwareInfo &hwInfo, bool disableEUFusionForKernel) const = 0; virtual uint64_t getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const = 0; virtual uint32_t getBindlessSurfaceExtendedMessageDescriptorValue(uint32_t surfStateOffset) const = 0; @@ -279,7 +279,7 @@ class GfxCoreHelperHw : public GfxCoreHelper { bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo) const override; - bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const override; + bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const override; bool isFusedEuDispatchEnabled(const HardwareInfo &hwInfo, bool disableEUFusionForKernel) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 8b51fdcc26..ccf4a52a83 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -444,7 +444,7 @@ uint8_t GfxCoreHelperHw::getBarriersCountFromHasBarriers(uint8_t hasB } template -inline bool GfxCoreHelperHw::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const { +inline bool GfxCoreHelperHw::isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const { return false; } diff --git a/shared/test/unit_test/helpers/hw_helper_tests.cpp b/shared/test/unit_test/helpers/hw_helper_tests.cpp index 7acf08f530..11964bfdaf 100644 --- a/shared/test/unit_test/helpers/hw_helper_tests.cpp +++ b/shared/test/unit_test/helpers/hw_helper_tests.cpp @@ -898,8 +898,9 @@ HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIsOffsetToSkipSetFFID if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) { GTEST_SKIP(); } - auto &gfxCoreHelper = GfxCoreHelper::get(hardwareInfo.platform.eRenderCoreFamily); - EXPECT_FALSE(gfxCoreHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo)); + const auto &gfxCoreHelper = getHelper(); + const auto &productHelper = getHelper(); + EXPECT_FALSE(gfxCoreHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo, productHelper)); } HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIsForceDefaultRCSEngineWARequiredCalledThenFalseIsReturned) {