Skip to content

Commit

Permalink
Introduce extension Macros
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EwanC committed May 21, 2024
1 parent c860bb5 commit 208d58f
Show file tree
Hide file tree
Showing 6 changed files with 418 additions and 28 deletions.
6 changes: 1 addition & 5 deletions CL/cl.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ typedef cl_bitfield cl_device_atomic_capabilities;
typedef cl_bitfield cl_device_device_enqueue_capabilities;
typedef cl_uint cl_khronos_vendor_id;
typedef cl_properties cl_mem_properties;
typedef cl_uint cl_version;
#endif
typedef cl_uint cl_version;

typedef struct _cl_image_format {
cl_channel_order image_channel_order;
Expand Down Expand Up @@ -914,8 +914,6 @@ typedef struct _cl_name_version {
/* cl_khronos_vendor_id */
#define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004

#ifdef CL_VERSION_3_0

/* cl_version */
#define CL_VERSION_MAJOR_BITS (10)
#define CL_VERSION_MINOR_BITS (10)
Expand All @@ -939,8 +937,6 @@ typedef struct _cl_name_version {
(((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \
((patch) & CL_VERSION_PATCH_MASK))

#endif

/********************************************************************************************************/

/* CL_NO_PROTOTYPES implies CL_NO_CORE_PROTOTYPES: */
Expand Down
Loading

0 comments on commit 208d58f

Please sign in to comment.