@@ -38,6 +38,8 @@ ESIMD_CALLEE(float *A, esimd::simd<float, VL> b, int i) SYCL_ESIMD_FUNCTION {
38
38
[[intel::device_indirectly_callable]] SYCL_EXTERNAL
39
39
simd<float , VL> __regcall SIMD_CALLEE (float *A, simd<float , VL> b,
40
40
int i) SYCL_ESIMD_FUNCTION;
41
+ [[intel::device_indirectly_callable]] SYCL_EXTERNAL
42
+ void __regcall SIMD_CALLEE_VOID (simd<float , VL> b, int i) SYCL_ESIMD_FUNCTION {}
41
43
42
44
float SPMD_CALLEE (float *A, float b, int i) { return A[i] + b; }
43
45
@@ -120,6 +122,7 @@ int main(void) {
120
122
if constexpr (use_invoke_simd) {
121
123
res = invoke_simd (sg, SIMD_CALLEE, uniform{A}, B[wi_id],
122
124
uniform{i});
125
+ invoke_simd (sg, SIMD_CALLEE_VOID, B[wi_id], uniform{i});
123
126
} else {
124
127
res = SPMD_CALLEE (A, B[wi_id], wi_id);
125
128
}
@@ -183,6 +186,8 @@ struct SIMD_FUNCTOR {
183
186
// E - N(u, N)
184
187
SYCL_EXTERNAL __regcall simd<short , 8 > operator ()(simd<float , 3 >,
185
188
simd<int , 8 >) const ;
189
+ // F - void
190
+ SYCL_EXTERNAL __regcall void operator ()(simd<float , 3 >) const ;
186
191
};
187
192
188
193
// Functor-based tests.
@@ -208,6 +213,10 @@ SYCL_EXTERNAL void foo(sub_group sg, float a, float b, float *ptr) {
208
213
// the target is "E" SIMD_FUNCTOR::() overload:
209
214
auto v = invoke_simd (sg, ftor, uniform{simd<float , 3 >{1 }}, 1 );
210
215
static_assert (std::is_same_v<decltype (v), short >);
216
+
217
+ // the target is "F" SIMD_FUNCTOR::() overload:
218
+ invoke_simd (sg, ftor, uniform{simd<float , 3 >{1 }});
219
+
211
220
}
212
221
213
222
// Lambda-based tests, repeat functor test cases above.
@@ -253,6 +262,29 @@ SYCL_EXTERNAL auto bar(sub_group sg, float a, float b, float *ptr, char ch) {
253
262
auto v = invoke_simd (sg, ftor, uniform{simd<float , 3 >{1 }}, 1 );
254
263
static_assert (std::is_same_v<decltype (v), short >);
255
264
}
265
+
266
+ {
267
+ const auto ftor = [=] [[gnu::regcall]] (simd<float , 16 >, float ) {};
268
+ invoke_simd (sg, ftor, 1 .f , uniform{a});
269
+ }
270
+ {
271
+ const auto ftor = [=] [[gnu::regcall]] (simd<float , 8 >, float , int ) {};
272
+ invoke_simd (sg, ftor, b, uniform{1 .f }, uniform{10 });
273
+ }
274
+ {
275
+ const auto ftor = [=] [[gnu::regcall]] (simd<float , 16 >, float *) {};
276
+ invoke_simd (sg, ftor, b, uniform{ptr});
277
+ }
278
+ {
279
+ const auto ftor = [=] [[gnu::regcall]] (float *, simd<float , 3 >,
280
+ simd<int , 5 >) {};
281
+ invoke_simd (sg, ftor, uniform{ptr}, uniform{simd<float , 3 >{1 }},
282
+ uniform{simd<int , 5 >{2 }});
283
+ }
284
+ {
285
+ const auto ftor = [=] [[gnu::regcall]] (simd<float , 3 >, simd<int , 8 >) {};
286
+ invoke_simd (sg, ftor, uniform{simd<float , 3 >{1 }}, 1 );
287
+ }
256
288
}
257
289
258
290
// Function-pointer-based test
@@ -262,6 +294,11 @@ SYCL_EXTERNAL auto barx(sub_group sg, float a, char ch,
262
294
static_assert (std::is_same_v<decltype (x), uniform<char >>);
263
295
}
264
296
297
+ SYCL_EXTERNAL auto barx_void (sub_group sg, float a, char ch,
298
+ __regcall void (f)(simd<float , 16 >, float )) {
299
+ invoke_simd (sg, f, 1 .f , uniform{a});
300
+ }
301
+
265
302
// Internal is_function_ref_v meta-API checks {
266
303
template <class F > void assert_is_func (F &&f) {
267
304
static_assert (
@@ -282,6 +319,7 @@ void check_f(
282
319
int(func)(float ), int(__regcall func_regcall)(int )) {
283
320
284
321
assert_is_func (SIMD_CALLEE);
322
+ assert_is_func (SIMD_CALLEE_VOID);
285
323
assert_is_func (ordinary_func);
286
324
287
325
assert_is_func (func_ptr);
0 commit comments