Skip to content

Commit d8cfdb4

Browse files
committed
Fix test, add feature macro and move extension to experimental
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 091b728 commit d8cfdb4

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_named_sub_group_sizes.asciidoc renamed to sycl/doc/extensions/experimental/sycl_ext_oneapi_named_sub_group_sizes.asciidoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ This extension also depends on the following other SYCL extensions:
5151

5252
== Status
5353

54-
This is a proposed extension specification, intended to gather community
55-
feedback. Interfaces defined in this specification may not be implemented yet
56-
or may be in a preliminary state. The specification itself may also change in
57-
incompatible ways before it is finalized. Shipping software products should not
58-
rely on APIs defined in this specification.
54+
This is an experimental extension specification, intended to provide early
55+
access to features and gather community feedback. Interfaces defined in this
56+
specification are implemented in {dpcpp}, but they are not finalized and may
57+
change incompatibly in future versions of {dpcpp} without prior notice.
58+
*Shipping software products should not rely on APIs defined in this
59+
specification.*
5960

6061

6162
== Overview

sycl/source/feature_test.hpp.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ inline namespace _V1 {
124124
#define SYCL_KHR_DEFAULT_CONTEXT 1
125125
#define SYCL_EXT_INTEL_EVENT_MODE 1
126126
#define SYCL_EXT_ONEAPI_TANGLE 1
127+
#define SYCL_EXT_ONEAPI_NAMED_SUB_GROUP_SIZES 1
127128

128129
// Unfinished KHR extensions. These extensions are only available if the
129130
// __DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS macro is defined.

sycl/test/extensions/properties/properties_kernel_named_sub_group_size.cpp

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,40 @@
33
// expected-no-diagnostics
44
#include <sycl/sycl.hpp>
55

6+
struct SGSizePrimaryKernelFunctor {
7+
SGSizePrimaryKernelFunctor() {}
8+
9+
void operator()(sycl::nd_item<1>) const {}
10+
11+
auto get(sycl::ext::oneapi::experimental::properties_tag) const {
12+
return sycl::ext::oneapi::experimental::properties{
13+
sycl::ext::oneapi::experimental::sub_group_size_primary};
14+
}
15+
};
16+
17+
struct SGSizeAutoKernelFunctor {
18+
SGSizeAutoKernelFunctor() {}
19+
20+
void operator()(sycl::nd_item<1>) const {}
21+
22+
auto get(sycl::ext::oneapi::experimental::properties_tag) const {
23+
return sycl::ext::oneapi::experimental::properties{
24+
sycl::ext::oneapi::experimental::sub_group_size_automatic};
25+
}
26+
};
27+
628
int main() {
7-
sycl::queue q;
8-
sycl::nd_range<1> ndr{6, 2};
29+
sycl::queue Q;
30+
sycl::nd_range<1> NDRange{6, 2};
931

10-
// CHECK: spir_kernel void @{{.*}}Kernel1()
32+
// CHECK: spir_kernel void @{{.*}}SGSizePrimaryKernelFunctor()
1133
// CHECK-SAME: !intel_reqd_sub_group_size ![[SGSizeAttr:[0-9]+]]
12-
sycl::ext::oneapi::experimental::properties P1{
13-
sycl::ext::oneapi::experimental::sub_group_size_primary};
14-
q.parallel_for<class Kernel1>(ndr, P1, [=](auto id) {});
34+
Q.parallel_for(NDRange, SGSizePrimaryKernelFunctor{});
1535

16-
// CHECK: spir_kernel void @{{.*}}Kernel2()
36+
// CHECK: spir_kernel void @{{.*}}SGSizeAutoKernelFunctor()
1737
// CHECK-NOT: intel_reqd_sub_group_size
1838
// CHECK-SAME: {
19-
sycl::ext::oneapi::experimental::properties P2{
20-
sycl::ext::oneapi::experimental::sub_group_size_automatic};
21-
q.parallel_for<class Kernel2>(ndr, P2, [=](auto id) {});
39+
Q.parallel_for(NDRange, SGSizeAutoKernelFunctor{});
2240
}
2341

2442
// CHECK: ![[SGSizeAttr]] = !{i32 -1}

0 commit comments

Comments
 (0)