File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
sycl/test/extensions/free_function_kernels Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsyntax-only -fsycl-device-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
2
+ #include < sycl/sycl.hpp>
3
+
4
+ namespace syclexp = sycl::ext::oneapi::experimental;
5
+
6
+ // expected-error@+2 {{'int &' cannot be used as the type of a kernel parameter}}
7
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::single_task_kernel)
8
+ void singleTaskKernelReference(int &Ref) {}
9
+
10
+ // expected-error@+2 {{'int &' cannot be used as the type of a kernel parameter}}
11
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::nd_range_kernel<2 >)
12
+ void ndRangeKernelReference(int &Ref) {}
13
+
14
+ // Diagnostic for these violations of the restrictions haven't been implemented
15
+ // yet.
16
+ // TODO: Add expected error when it will be implemented.
17
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::single_task_kernel)
18
+ void singleTaskKernelVariadic(...) {}
19
+
20
+ // TODO: Add expected error when it will be implemented.
21
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::nd_range_kernel<3 >)
22
+ void ndRangeKernelVariadic(...) {}
23
+
24
+ // TODO: Add expected error when it will be implemented.
25
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::single_task_kernel)
26
+ void singleTaskKernelDefaultValues(int Value = 1 ) {}
27
+
28
+ // TODO: Add expected error when it will be implemented.
29
+ SYCL_EXT_ONEAPI_FUNCTION_PROPERTY (syclexp::nd_range_kernel<1 >)
30
+ void ndRangeKernelDefaultValues(int Value = 1 ) {}
You can’t perform that action at this time.
0 commit comments