Skip to content

Commit

Permalink
Introduce extension macros (#251)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
EwanC authored Jun 18, 2024
1 parent c860bb5 commit dcf7d4f
Show file tree
Hide file tree
Showing 6 changed files with 462 additions and 29 deletions.
8 changes: 2 additions & 6 deletions CL/cl.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ typedef cl_uint cl_kernel_exec_info;
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;
typedef cl_properties cl_mem_properties;
#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 dcf7d4f

Please sign in to comment.