Skip to content

Commit 22490bb

Browse files
feature: Enable support for cl_intel_subgroup_buffer_prefetch
This change enables support for cl_intel_subgroup_buffer_prefetch extension for PVC and later. Related-To: GSD-7825 Signed-off-by: Ratajewski, Andrzej <andrzej.ratajewski@intel.com> Source: 521add6
1 parent 4d7cd3e commit 22490bb

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

opencl/test/unit_test/xe_hpc_core/pvc/test_cl_device_caps_pvc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ PVCTEST_F(PvcClDeviceCapsTests, givenPvcProductWhenDeviceCapsInitializedThenAddP
2424
EXPECT_TRUE(hasSubstr(dInfo.deviceExtensions, std::string("cl_khr_subgroup_named_barrier")));
2525
EXPECT_TRUE(hasSubstr(dInfo.deviceExtensions, std::string("cl_intel_subgroup_extended_block_read")));
2626
EXPECT_TRUE(hasSubstr(dInfo.deviceExtensions, std::string("cl_intel_subgroup_2d_block_io")));
27+
EXPECT_TRUE(hasSubstr(dInfo.deviceExtensions, std::string("cl_intel_subgroup_buffer_prefetch")));
2728
}

shared/source/helpers/compiler_product_helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class CompilerProductHelper {
6565
virtual bool isSubgroupNamedBarrierSupported() const = 0;
6666
virtual bool isSubgroupExtendedBlockReadSupported() const = 0;
6767
virtual bool isSubgroup2DBlockIOSupported() const = 0;
68+
virtual bool isSubgroupBufferPrefetchSupported() const = 0;
6869
virtual bool isForceToStatelessRequired() const = 0;
6970
virtual bool failBuildProgramWithStatefulAccessPreference() const = 0;
7071
virtual bool isDotIntegerProductExtensionSupported() const = 0;
@@ -114,6 +115,7 @@ class CompilerProductHelperHw : public CompilerProductHelper {
114115
bool isSubgroupNamedBarrierSupported() const override;
115116
bool isSubgroupExtendedBlockReadSupported() const override;
116117
bool isSubgroup2DBlockIOSupported() const override;
118+
bool isSubgroupBufferPrefetchSupported() const override;
117119
bool isForceToStatelessRequired() const override;
118120
bool failBuildProgramWithStatefulAccessPreference() const override;
119121
bool isDotIntegerProductExtensionSupported() const override;

shared/source/helpers/compiler_product_helper_base.inl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ std::string CompilerProductHelperHw<gfxProduct>::getDeviceExtensions(const Hardw
195195
if (isSubgroup2DBlockIOSupported()) {
196196
extensions += "cl_intel_subgroup_2d_block_io ";
197197
}
198+
if (isSubgroupBufferPrefetchSupported()) {
199+
extensions += "cl_intel_subgroup_buffer_prefetch ";
200+
}
198201
if (isDotIntegerProductExtensionSupported()) {
199202
extensions += "cl_khr_integer_dot_product ";
200203
}

shared/source/helpers/compiler_product_helper_before_xe_hpc.inl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ bool CompilerProductHelperHw<gfxProduct>::isSubgroup2DBlockIOSupported() const {
3131
return false;
3232
}
3333

34+
template <PRODUCT_FAMILY gfxProduct>
35+
bool CompilerProductHelperHw<gfxProduct>::isSubgroupBufferPrefetchSupported() const {
36+
return false;
37+
}
38+
3439
} // namespace NEO

shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ bool CompilerProductHelperHw<gfxProduct>::isSubgroup2DBlockIOSupported() const {
3535
return true;
3636
}
3737

38+
template <PRODUCT_FAMILY gfxProduct>
39+
bool CompilerProductHelperHw<gfxProduct>::isSubgroupBufferPrefetchSupported() const {
40+
return true;
41+
}
42+
3843
} // namespace NEO

shared/test/unit_test/helpers/compiler_product_helper_tests.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ HWTEST2_F(CompilerProductHelperFixture, GivenPreXeHpcThenSubgroup2DBlockIOIsNotS
126126
EXPECT_FALSE(compilerProductHelper.isSubgroup2DBlockIOSupported());
127127
}
128128

129+
HWTEST2_F(CompilerProductHelperFixture, GivenXeHpcAndLaterThenSubgroupBufferPrefetchIsSupported, IsAtLeastXeHpcCore) {
130+
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
131+
132+
EXPECT_TRUE(compilerProductHelper.isSubgroupBufferPrefetchSupported());
133+
}
134+
135+
HWTEST2_F(CompilerProductHelperFixture, GivenPreXeHpcThenSubgroupBufferPrefetchIsNotSupported, IsAtMostXeHpgCore) {
136+
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
137+
138+
EXPECT_FALSE(compilerProductHelper.isSubgroupBufferPrefetchSupported());
139+
}
140+
129141
HWTEST2_F(CompilerProductHelperFixture, GivenCompilerProductHelperThenBFloat16ConversionIsSupportedBasedOnReleaseHelper, IsNotXeHpcCore) {
130142
auto &compilerProductHelper = pDevice->getCompilerProductHelper();
131143
auto releaseHelper = pDevice->getReleaseHelper();

0 commit comments

Comments
 (0)