File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -1181,7 +1181,8 @@ def SYCLKernel : InheritableAttr {
1181
1181
// e.g. because the function is already vectorized. Used to mark SYCL
1182
1182
// explicit SIMD kernels and functions.
1183
1183
def SYCLSimd : InheritableAttr {
1184
- let Spellings = [GNU<"sycl_explicit_simd">];
1184
+ let Spellings = [GNU<"sycl_explicit_simd">,
1185
+ CXX11<"intel", "sycl_explicit_simd">];
1185
1186
let Subjects = SubjectList<[Function]>;
1186
1187
let LangOpts = [SYCLExplicitSIMD];
1187
1188
let Documentation = [SYCLSimdDocs];
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ class AttributeCommonInfo {
167
167
ParsedAttr == AT_SYCLIntelMaxGlobalWorkDim ||
168
168
ParsedAttr == AT_SYCLIntelNoGlobalWorkOffset ||
169
169
ParsedAttr == AT_SYCLIntelUseStallEnableClusters ||
170
- ParsedAttr == AT_SYCLIntelLoopFuse)
170
+ ParsedAttr == AT_SYCLIntelLoopFuse || ParsedAttr == AT_SYCLSimd )
171
171
return true ;
172
172
173
173
return false ;
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ void kernel(const Func &f) __attribute__((sycl_kernel)) {
16
16
void bar () {
17
17
kernel<class MyKernel >([=]() __attribute__ ((sycl_explicit_simd)){});
18
18
// CHECK: define {{.*}}spir_kernel void @_ZTSZ3barvE8MyKernel() {{.*}} !sycl_explicit_simd ![[EMPTY:[0-9]+]] !intel_reqd_sub_group_size ![[REQD_SIZE:[0-9]+]]
19
+
20
+ kernel<class MyEsimdKernel >([=]() [[intel::sycl_explicit_simd]]{});
21
+ // CHECK: define {{.*}}spir_kernel void @_ZTSZ3barvE13MyEsimdKernel() {{.*}} !sycl_explicit_simd ![[EMPTY:[0-9]+]] !intel_reqd_sub_group_size ![[REQD_SIZE]]
19
22
}
20
23
21
24
// CHECK: !spirv.Source = !{[[LANG:![0-9]+]]}
Original file line number Diff line number Diff line change @@ -75,3 +75,31 @@ struct Kernel3 {
75
75
void bar3 () {
76
76
kernel3 (Kernel3{});
77
77
}
78
+
79
+ // -- Clang-style [[sycl_explicit_simd]] attribute for functor object kernel.
80
+
81
+ template <typename F, typename ID = F>
82
+ [[clang::sycl_kernel]] void kernel4 (const F &f) {
83
+ f ();
84
+ }
85
+
86
+ struct Kernel4 {
87
+ [[intel::sycl_explicit_simd]] void operator ()() const {}
88
+ };
89
+
90
+ void bar4 () {
91
+ kernel4 (Kernel4{});
92
+ }
93
+
94
+ // -- Clang-style [[sycl_explicit_simd]] attribute for lambda and free function.
95
+
96
+ template <typename ID, typename F>
97
+ [[clang::sycl_kernel]] void kernel5 (const F &f) {
98
+ f ();
99
+ }
100
+
101
+ [[intel::sycl_explicit_simd]] void g5 () {}
102
+
103
+ void test5 () {
104
+ kernel5<class Kernel5 >([=]() [[intel::sycl_explicit_simd]] { g5 (); });
105
+ }
You can’t perform that action at this time.
0 commit comments