File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ include::cxx4opencl/diff2openclc.txt[]
4646
4747include::cxx4opencl/address_spaces.txt[]
4848
49+ <<<<
50+
51+ include::cxx4opencl/kernel.txt[]
52+
4953<<<
5054
5155include::cxx4opencl/references.txt[]
Original file line number Diff line number Diff line change 1+ // Copyright 2021 The Khronos Group. This work is licensed under a
2+ // Creative Commons Attribution 4.0 International License; see
3+ // http://creativecommons.org/licenses/by/4.0/
4+
5+ [[kernel_function]]
6+ === Kernel functions
7+
8+ Kernel functions have implicit C linkage ({cpp}17 `[dcl.link]`) which
9+ means that {cpp} specific features are not supported. Therefore, the kernel
10+ functions:
11+
12+ * Can not be class members ({cpp}17 `[class.mfct]`);
13+ * Can not be overloaded ({cpp}17 `[over]`);
14+ * Can not be function templates ({cpp}17 `[temp.fct]`).
15+
16+ :fn-ker-par-ref: footnote:[Whether C++ features (e.g references) can be used \
17+ in functions with C linkage is implementation-defined ({cpp}17 [dcl.link\]).]
18+
19+ Moreover the types used in parameters of the kernel functions must be:
20+
21+ * Trivial and standard-layout types {cpp}17 `[basic.types]` (plain old data
22+ types) for parameters passed by value;
23+ * Standard layout types for pointer parameters. The same applies to
24+ references{fn-ker-par-ref} if an implementation supports them in kernel
25+ parameters.
26+
27+ These are additional restrictions to the list detailed in `OpenCL C v2.0
28+ section 6.9`.
You can’t perform that action at this time.
0 commit comments