|
5 | 5 | [[intro]] |
6 | 6 | == Introduction |
7 | 7 |
|
8 | | -This language is built on top of OpenCL C v2.0 and {cpp}17 enabling |
| 8 | +This language is built on top of OpenCL C 3.0 unified and {cpp}17 enabling |
9 | 9 | most of regular {cpp} features in OpenCL kernel code. Most functionality |
10 | 10 | from {cpp} and OpenCL C is inherited. Since both OpenCL C and {cpp} are |
11 | 11 | derived from C and moreover {cpp} is almost fully backward compatible with C, |
12 | 12 | the main design principle of {cpp} for OpenCL is to reapply existing OpenCL |
13 | 13 | concepts to {cpp}. Therefore, it is important to refer to |
14 | | -<<opencl-spec, The OpenCL Specification, Version 2.0>> `section |
| 14 | +<<opencl-spec, The OpenCL Specification, Version 3.0>> `section |
15 | 15 | 3.2` and `section 3.3` detailing fundamental differences of OpenCL execution |
16 | 16 | and memory models from the conventional C and {cpp} view. |
17 | 17 |
|
18 | | -This document describes the programming language in details. It is not |
| 18 | +This document describes the programming language in detail. It is not |
19 | 19 | structured as a standalone document, but rather as an addition to OpenCL C |
20 | | -v2.0 defined in <<openclc-spec, The OpenCL C Specification, Version 2.0>> |
21 | | -and {cpp}17 defined in <<cpp17-spec, The C++17 Specification>>. Where necessary |
22 | | -this document refers to the specifications of those languages accordingly. |
23 | | -A full understanding of {cpp} for OpenCL requires familiarity with the |
24 | | -specifications or other documentation of both languages that {cpp} for OpenCL |
| 20 | +3.0 unified specification defined in <<openclc-spec, The OpenCL C Specification, |
| 21 | +Version 3.0>> and {cpp}17 defined in <<cpp17-spec, The C++17 Specification>>. |
| 22 | +Where necessary this document refers to the specifications of those languages |
| 23 | +accordingly. A full understanding of {cpp} for OpenCL requires familiarity with |
| 24 | +the specifications or other documentation of both languages that {cpp} for OpenCL |
25 | 25 | is built upon. |
26 | 26 |
|
27 | 27 | The description of {cpp} for OpenCL starts from highlighting <<diff2openclc, |
28 | 28 | _the differences to OpenCL C_>> and <<diff2cxx, _the differences to {cpp}_>>. |
29 | 29 |
|
30 | 30 | The majority of content covers the behavior that is not documented in |
31 | | -the OpenCL C v2.0 `section 6` and {cpp}17 specifications. This is mainly |
| 31 | +the `OpenCL C 3.0 s6` and {cpp}17 specifications. This is mainly |
32 | 32 | related to interactions between OpenCL and {cpp} language features. |
33 | 33 |
|
| 34 | +This document describes C++ for OpenCL language |
| 35 | + |
| 36 | + * version 1.0 that is backward compatible with OpenCL 2.0; and |
| 37 | + * version 2021 that is backward compatible with OpenCL 3.0. |
| 38 | + |
| 39 | +== Version differences |
| 40 | + |
| 41 | +The main difference between {cpp} for OpenCL version 1.0 and version 2021 |
| 42 | +comes from the difference between OpenCL 2.0 and OpenCL 3.0 with which they |
| 43 | +are respectively compatible. Support for some features of {cpp} for OpenCL 1.0 |
| 44 | +has become optional as described in `OpenCL 3.0 s6.2.1`. Predefined feature |
| 45 | +macros from OpenCL C 3.0 can be used to detect which optional features are present. |
| 46 | + |
| 47 | +This impacts some C++ specific semantics mainly due to optionality of the |
| 48 | +generic address space (i.e. `+__opencl_c_generic_address_space+` feature) or |
| 49 | +program scope variables (i.e. `+__opencl_c_program_scope_global_variables+` |
| 50 | +feature). |
| 51 | + |
34 | 52 | == The {cpp} for OpenCL Programming Language |
35 | 53 |
|
36 | | -This programming language inherits features from `OpenCL C v2.0, |
37 | | -s6` as well as {cpp}17. Detailed aspects of OpenCL and {cpp} are not |
38 | | -described in this document as they can be found in their official |
39 | | -specifications. |
| 54 | +This programming language inherits features from `OpenCL C 3.0 s6` as well |
| 55 | +as {cpp}17. Detailed aspects of OpenCL and {cpp} are not described in this |
| 56 | +document as they can be found in their official specifications. |
40 | 57 |
|
41 | 58 | This section documents various language features of {cpp} for OpenCL that are |
42 | | -not covered in either OpenCL or {cpp} specifications, in particular: |
| 59 | +not covered in neither OpenCL nor {cpp} specifications, in particular: |
43 | 60 |
|
44 | 61 | * any behavior that deviates from {cpp}17; |
45 | | - * any behavior that deviates from OpenCL C v2.0; |
| 62 | + * any behavior that deviates from OpenCL C 2.0 or 3.0; |
46 | 63 | * any behavior that is not governed by OpenCL C and {cpp}. |
47 | 64 |
|
48 | | -All language extensions to OpenCL C v2.0 or earlier are applicable to |
49 | | -C++ for OpenCL. |
| 65 | +All language extensions to OpenCL C are applicable to C++ for OpenCL. |
| 66 | + * Extensions to OpenCL C 2.0 or earlier versions apply to C++ for OpenCL |
| 67 | + version 1.0. |
| 68 | + * Extensions to OpenCL 3.0 or earlier versions except for OpenCL 2.0, apply to |
| 69 | + C++ for OpenCL 2021. |
0 commit comments