Skip to content

Commit 208d58f

Browse files
author
Ewan Crawford
committed
Introduce extension Macros
Implement idea from #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. Extensions can then increment the version when they change the APIs without breaking user code. See [CL_MAKE_VERSION](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_MAKE_VERSION) for how the macro version is defined.
1 parent c860bb5 commit 208d58f

6 files changed

Lines changed: 418 additions & 28 deletions

File tree

CL/cl.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ typedef cl_bitfield cl_device_atomic_capabilities;
113113
typedef cl_bitfield cl_device_device_enqueue_capabilities;
114114
typedef cl_uint cl_khronos_vendor_id;
115115
typedef cl_properties cl_mem_properties;
116-
typedef cl_uint cl_version;
117116
#endif
117+
typedef cl_uint cl_version;
118118

119119
typedef struct _cl_image_format {
120120
cl_channel_order image_channel_order;
@@ -914,8 +914,6 @@ typedef struct _cl_name_version {
914914
/* cl_khronos_vendor_id */
915915
#define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004
916916

917-
#ifdef CL_VERSION_3_0
918-
919917
/* cl_version */
920918
#define CL_VERSION_MAJOR_BITS (10)
921919
#define CL_VERSION_MINOR_BITS (10)
@@ -939,8 +937,6 @@ typedef struct _cl_name_version {
939937
(((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \
940938
((patch) & CL_VERSION_PATCH_MASK))
941939

942-
#endif
943-
944940
/********************************************************************************************************/
945941

946942
/* CL_NO_PROTOTYPES implies CL_NO_CORE_PROTOTYPES: */

0 commit comments

Comments
 (0)