Skip to content

Commit 2ea2733

Browse files
authored
clarify __OPENCL_VERSION__ (#522)
* clarify __OPENCL_VERSION__ * clarify the integer value returned for newer OpenCL versions * change offline compiler behavior from must to should * change offline compiler behavior from should to may
1 parent a6c439f commit 2ea2733

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

OpenCL_C.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,10 +3430,13 @@ The following predefined macro names are available.
34303430
source line (an integer constant).
34313431

34323432
`+__OPENCL_VERSION__+` ::
3433-
Substitutes an integer reflecting the version number of the OpenCL
3434-
supported by the OpenCL device.
3435-
The version of OpenCL described in this document will have
3436-
`+__OPENCL_VERSION__+` substitute the integer 300.
3433+
For OpenCL devices with OpenCL version less than or equal to OpenCL 2.0,
3434+
substitutes an integer value reflecting the OpenCL version supported by the
3435+
device.
3436+
This predefined macro is <<unified-spec, deprecated by>> OpenCL 2.1.
3437+
For OpenCL devices with OpenCL version greater than OpenCL 2.0, it must be
3438+
defined but may substitute any implementation-defined integer value greater
3439+
than 200, reflecting OpenCL 2.0. footnote:[{fn-OPENCL_VERSION}]
34373440

34383441
`CL_VERSION_1_0` ::
34393442
Substitutes the integer 100 reflecting the OpenCL 1.0 version.

c/footnotes.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ Here `TYPE_MIN` and `TYPE_MIN_EXP` should be substituted by constants appropriat
192192
I.e. the _global_work_size_ values specified to *clEnqueueNDRangeKernel* are not evenly divisible by the _local_work_size_ values for each dimension. \
193193
]
194194

195+
:fn-OPENCL_VERSION: pass:n[ \
196+
When OpenCL C is compiled offline, `+__OPENCL_VERSION__+` may be defined and may substitute any implementation-defined integer value. \
197+
]
198+
195199
:fn-pointer-invalid-value-indirection: pass:n[ \
196200
Among the invalid values for dereferencing a pointer by the unary *+*+* operator are a null pointer, an address inappropriately aligned for the type of object pointed to, and the address of an object after the end of its lifetime. \
197201
If *+*P+* is an l-value and *T* is the name of an object pointer type, *+*(T)P+* is an l-value that has a type compatible with that to which *T* points. \

0 commit comments

Comments
 (0)