Skip to content

Commit 5270423

Browse files
Disable cl_khr_subgroups extension on gen12.
Resolves: NEO-3622 Change-Id: Idab55e5fb6a51ea0a08714f447bb9fce85f1dbcd Signed-off-by: Piotr Zdunowski <[email protected]>
1 parent 3e881ae commit 5270423

File tree

10 files changed

+93
-20
lines changed

10 files changed

+93
-20
lines changed

opencl/source/cl_device/cl_device_caps.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,14 @@ void ClDevice::initializeCaps() {
116116
auto supportsVme = hwInfo.capabilityTable.supportsVme;
117117
auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme;
118118

119+
deviceInfo.independentForwardProgress = false;
120+
119121
if (enabledClVersion >= 21) {
120-
deviceInfo.independentForwardProgress = true;
121-
deviceExtensions += "cl_khr_subgroups ";
122+
if (hwHelper.isIndependentForwardProgressSupported()) {
123+
deviceInfo.independentForwardProgress = true;
124+
deviceExtensions += "cl_khr_subgroups ";
125+
}
126+
122127
deviceExtensions += "cl_khr_il_program ";
123128
if (supportsVme) {
124129
deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation ";
@@ -128,8 +133,6 @@ void ClDevice::initializeCaps() {
128133
}
129134
deviceExtensions += "cl_intel_spirv_subgroups ";
130135
deviceExtensions += "cl_khr_spirv_no_integer_wrap_decoration ";
131-
} else {
132-
deviceInfo.independentForwardProgress = false;
133136
}
134137

135138
if (enabledClVersion >= 20) {

opencl/source/gen12lp/hw_helper_gen12lp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ std::string HwHelperHw<Family>::getExtensions() const {
150150
return "cl_intel_subgroup_local_block_io ";
151151
}
152152

153+
template <>
154+
bool HwHelperHw<Family>::isIndependentForwardProgressSupported() {
155+
return false;
156+
}
157+
153158
template <>
154159
void MemorySynchronizationCommands<Family>::setExtraCacheFlushFields(Family::PIPE_CONTROL *pipeControl) {
155160
pipeControl->setHdcPipelineFlush(true);

opencl/test/unit_test/device/device_caps_tests.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
140140
EXPECT_EQ(expectedDeviceSubgroups[i], sharedCaps.maxSubGroups[i]);
141141
}
142142

143-
if (device->getEnabledClVersion() >= 21) {
144-
EXPECT_TRUE(caps.independentForwardProgress != 0);
145-
} else {
146-
EXPECT_FALSE(caps.independentForwardProgress != 0);
147-
}
148-
149143
EXPECT_EQ(sharedCaps.maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), caps.maxNumOfSubGroups);
150144

151145
EXPECT_EQ(1024u, caps.maxOnDeviceEvents);
@@ -396,15 +390,6 @@ TEST_F(DeviceGetCapsTest, givenEnableSharingFormatQuerySetTrueAndEnabledMultiple
396390
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_intel_sharing_format_query "))));
397391
}
398392

399-
TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClKhrSubgroupsExtension) {
400-
DebugManagerStateRestore dbgRestorer;
401-
DebugManager.flags.ForceOCLVersion.set(21);
402-
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
403-
const auto &caps = device->getDeviceInfo();
404-
405-
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
406-
}
407-
408393
TEST_F(DeviceGetCapsTest, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntReportClKhrSubgroupsExtension) {
409394
DebugManagerStateRestore dbgRestorer;
410395
DebugManager.flags.ForceOCLVersion.set(20);

opencl/test/unit_test/gen11/test_device_caps_gen11.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,23 @@ GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckExtensionsThenSubgroupLocalBlock
7070

7171
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_subgroup_local_block_io")));
7272
}
73+
74+
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
75+
const auto &caps = pClDevice->getDeviceInfo();
76+
77+
if (pClDevice->getEnabledClVersion() >= 21) {
78+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
79+
} else {
80+
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
81+
}
82+
}
83+
84+
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
85+
const auto &caps = pClDevice->getDeviceInfo();
86+
87+
if (pClDevice->getEnabledClVersion() >= 21) {
88+
EXPECT_TRUE(caps.independentForwardProgress != 0);
89+
} else {
90+
EXPECT_FALSE(caps.independentForwardProgress != 0);
91+
}
92+
}

opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenSubgroupLocalB
3434
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_subgroup_local_block_io")));
3535
}
3636

37+
TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension) {
38+
const auto &caps = pClDevice->getDeviceInfo();
39+
40+
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
41+
}
42+
43+
TGLLPTEST_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress) {
44+
const auto &caps = pClDevice->getDeviceInfo();
45+
46+
EXPECT_FALSE(caps.independentForwardProgress);
47+
}
48+
3749
TGLLPTEST_F(Gen12LpDeviceCaps, allSkusSupportCorrectlyRoundedDivideSqrt) {
3850
const auto &caps = pClDevice->getDeviceInfo();
3951
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);

opencl/test/unit_test/gen8/test_device_caps_gen8.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ GEN8TEST_F(Gen8DeviceCaps, defaultPreemptionMode) {
1818
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
1919
}
2020

21+
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
22+
const auto &caps = pClDevice->getDeviceInfo();
23+
if (pClDevice->getEnabledClVersion() >= 21) {
24+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
25+
} else {
26+
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
27+
}
28+
}
29+
30+
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
31+
const auto &caps = pClDevice->getDeviceInfo();
32+
33+
if (pClDevice->getEnabledClVersion() >= 21) {
34+
EXPECT_TRUE(caps.independentForwardProgress != 0);
35+
} else {
36+
EXPECT_FALSE(caps.independentForwardProgress != 0);
37+
}
38+
}
39+
2140
GEN8TEST_F(Gen8DeviceCaps, kmdNotifyMechanism) {
2241
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
2342
EXPECT_EQ(50000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);

opencl/test/unit_test/gen9/test_device_caps_gen9.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ GEN9TEST_F(Gen9DeviceCaps, skuSpecificCaps) {
2626
}
2727
}
2828

29+
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
30+
const auto &caps = pClDevice->getDeviceInfo();
31+
if (pClDevice->getEnabledClVersion() >= 21) {
32+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
33+
} else {
34+
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
35+
}
36+
}
37+
38+
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
39+
const auto &caps = pClDevice->getDeviceInfo();
40+
41+
if (pClDevice->getEnabledClVersion() >= 21) {
42+
EXPECT_TRUE(caps.independentForwardProgress != 0);
43+
} else {
44+
EXPECT_FALSE(caps.independentForwardProgress != 0);
45+
}
46+
}
47+
2948
GEN9TEST_F(Gen9DeviceCaps, allSkusSupportCorrectlyRoundedDivideSqrt) {
3049
const auto &caps = pClDevice->getDeviceInfo();
3150
EXPECT_NE(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);

opencl/test/unit_test/platform/platform_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ TEST_F(PlatformTest, PlatformgetAsCompilerEnabledExtensionsString) {
9696
pPlatform->initializeWithNewDevices();
9797
auto compilerExtensions = pPlatform->getClDevice(0)->peekCompilerExtensions();
9898

99+
auto &hwHelper = HwHelper::get(pPlatform->getClDevice(0)->getHardwareInfo().platform.eRenderCoreFamily);
100+
99101
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl")));
100-
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos) {
102+
if (std::string(pPlatform->getClDevice(0)->getDeviceInfo().clVersion).find("OpenCL 2.1") != std::string::npos && hwHelper.isIndependentForwardProgressSupported()) {
101103
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
102104
}
103105
}

shared/source/helpers/hw_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class HwHelper {
8383
virtual bool isOffsetToSkipSetFFIDGPWARequired(const HardwareInfo &hwInfo) const = 0;
8484
virtual bool is3DPipelineSelectWARequired(const HardwareInfo &hwInfo) const = 0;
8585
virtual bool isFusedEuDispatchEnabled(const HardwareInfo &hwInfo) const = 0;
86+
virtual bool isIndependentForwardProgressSupported() = 0;
8687

8788
static uint32_t getSubDevicesCount(const HardwareInfo *pHwInfo);
8889
static uint32_t getEnginesCount(const HardwareInfo &hwInfo);
@@ -214,6 +215,8 @@ class HwHelperHw : public HwHelper {
214215

215216
uint32_t getMinimalSIMDSize() override;
216217

218+
bool isIndependentForwardProgressSupported() override;
219+
217220
protected:
218221
static const AuxTranslationMode defaultAuxTranslationMode;
219222
HwHelperHw() = default;

shared/source/helpers/hw_helper_bdw_plus.inl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ uint32_t HwHelperHw<GfxFamily>::calculateAvailableThreadCount(PRODUCT_FAMILY fam
6666
return threadsPerEu * euCount;
6767
}
6868

69+
template <typename GfxFamily>
70+
bool HwHelperHw<GfxFamily>::isIndependentForwardProgressSupported() {
71+
return true;
72+
}
73+
6974
template <typename GfxFamily>
7075
void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
7176
}

0 commit comments

Comments
 (0)