Skip to content

Commit dcf7d4f

Browse files
author
Ewan Crawford
authored
Introduce extension macros (#251)
* 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. * Fix CI issues Clang format changes and other fixes
1 parent c860bb5 commit dcf7d4f

6 files changed

Lines changed: 462 additions & 29 deletions

File tree

CL/cl.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ typedef cl_uint cl_kernel_exec_info;
112112
typedef cl_bitfield cl_device_atomic_capabilities;
113113
typedef cl_bitfield cl_device_device_enqueue_capabilities;
114114
typedef cl_uint cl_khronos_vendor_id;
115-
typedef cl_properties cl_mem_properties;
116-
typedef cl_uint cl_version;
115+
typedef cl_properties cl_mem_properties;
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)