KhronosGroup / OpenCL-Headers

Khronos OpenCL-Headers
Apache License 2.0
666 stars 236 forks source link

Introduce extension macros #251

Closed EwanC closed 4 months ago

EwanC commented 5 months ago

Implement idea from https://github.com/KhronosGroup/OpenCL-Headers/issues/248 to add an version macro to the extension headers so that users can guard application code using the macro to ensure the correct APIs are being used. This uses the XML from https://github.com/KhronosGroup/OpenCL-Docs/pull/1161 which forces extension to set a revision value.

Extensions can then increment the version when they change the APIs without breaking user code, providing applications have guarded their usage.

See CL_MAKE_VERSION for how the macro version is defined. Note that the definitions of this macro and cl_version have been taken out of the CL_VERSION_3_0 version guard to allow them to always be used by an application. This is because there functionality is implemented in the headers and not affected in any way by the OpenCL implementation being used, and the OpenCL version that implementation supports.

bashbaug commented 4 months ago

Merging as discussed in the June 18th teleconference.