From 27ca56148212d6796d9daaadc8a911e240c03791 Mon Sep 17 00:00:00 2001 From: Maciej Plewka Date: Fri, 6 May 2022 09:35:12 +0000 Subject: [PATCH] Apply max threads w/a only for specyfic Arc devices With this commit w/a for max thread value will be applied only for Native 512EU devices. Signed-off-by: Maciej Plewka --- .../unit_test/xe_hpg_core/dg2/test_device_caps_dg2.cpp | 7 +++++-- .../xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl | 2 +- .../common/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/opencl/test/unit_test/xe_hpg_core/dg2/test_device_caps_dg2.cpp b/opencl/test/unit_test/xe_hpg_core/dg2/test_device_caps_dg2.cpp index aa8459d8be..907f3c1b5a 100644 --- a/opencl/test/unit_test/xe_hpg_core/dg2/test_device_caps_dg2.cpp +++ b/opencl/test/unit_test/xe_hpg_core/dg2/test_device_caps_dg2.cpp @@ -26,7 +26,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenDg2ProductWhenCheckFp64SupportThenReturnFalse) EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsFP64); } -DG2TEST_F(Dg2UsDeviceIdTest, givenDeviceThatHasHighNumberOfExecutionUnitsAndA0SteppingWhenMaxWorkgroupSizeIsComputedThenItIsLimitedTo512) { +DG2TEST_F(Dg2UsDeviceIdTest, givenDeviceThatHasHighNumberOfExecutionUnitsA0SteppingAndG10DevIdWhenMaxWorkgroupSizeIsComputedThenItIsLimitedTo512) { HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; PLATFORM &myPlatform = myHwInfo.platform; @@ -37,13 +37,14 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenDeviceThatHasHighNumberOfExecutionUnitsAndA0St mySysInfo.DualSubSliceCount = 2; mySysInfo.ThreadCount = 32 * 8; myPlatform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); + myPlatform.usDeviceID = DG2_G10_IDS[0]; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&myHwInfo)); EXPECT_EQ(512u, device->sharedDeviceInfo.maxWorkGroupSize); EXPECT_EQ(device->sharedDeviceInfo.maxWorkGroupSize / 8, device->getDeviceInfo().maxNumOfSubGroups); } -DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuAndA0SteppingWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin) { +DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuA0SteppingAndG10DevIdWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin) { HardwareInfo myHwInfo = *defaultHwInfo; GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo; FeatureTable &mySkuTable = myHwInfo.featureTable; @@ -54,6 +55,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuAndA0SteppingWhenCalculating mySysInfo.EuCountPerPoolMin = 99999; mySkuTable.flags.ftrPooledEuEnabled = 1; myPlatform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); + myPlatform.usDeviceID = DG2_G10_IDS[0]; auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&myHwInfo)); @@ -65,6 +67,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuAndA0SteppingWhenCalculating DG2TEST_F(Dg2UsDeviceIdTest, givenRevisionEnumThenProperMaxThreadsForWorkgroupIsReturned) { const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily); + hardwareInfo.platform.usDeviceID = DG2_G10_IDS[0]; hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo); EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u)); diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 931d1ece90..ce2ce391bb 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -65,7 +65,7 @@ bool HwInfoConfigHw::isAdditionalStateBaseAddressWARequired(const Ha template <> bool HwInfoConfigHw::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { uint32_t stepping = getSteppingFromHwRevId(hwInfo); - return REVISION_A0 == stepping; + return (REVISION_A0 == stepping && DG2::isG10(hwInfo)); } template <> diff --git a/shared/test/common/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp b/shared/test/common/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp index b4207e7834..be725bac81 100644 --- a/shared/test/common/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp +++ b/shared/test/common/xe_hpg_core/dg2/test_hw_info_config_dg2.cpp @@ -36,8 +36,11 @@ DG2TEST_F(TestDg2HwInfoConfig, givenDG2WithA0SteppingThenMaxThreadsForWorkgroupW const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); hwInfo->platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, *hwInfo); - auto isWARequired = hwInfoConfig.isMaxThreadsForWorkgroupWARequired(pDevice->getHardwareInfo()); - EXPECT_TRUE(isWARequired); + for (const auto &devId : DG2_G10_IDS) { + hwInfo->platform.usDeviceID = devId; + auto isWARequired = hwInfoConfig.isMaxThreadsForWorkgroupWARequired(pDevice->getHardwareInfo()); + EXPECT_TRUE(isWARequired); + } } DG2TEST_F(TestDg2HwInfoConfig, givenDG2WithBSteppingThenMaxThreadsForWorkgroupWAIsNotRequired) {