-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define function types for prototype declaration #230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I have a few comments but it would be fine to address them in a subsequent PR (or not at all).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I did some basic testing on Windows and everything seems to be in order.
Thank for taking a look. Should we discuss this next week at the teleconference before merging? |
Merging as discussed on the May 9th teleconference. |
This is pull request implements what I have been describing in a recent WG meeting: providing and using type function definitions to declare symbols and pointers. This yields several benefits:
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
is activated: see: https://github.com/KhronosGroup/OpenCL-ICD-Loader/blob/ee329edc23258a53f9b5799446f7417d853ee143/loader/icd_dispatch.c#L26-L32. Instead, we could now write:I kept the original exports as some users could be parsing the headers for the original declarations (We do in the CLHPP testing for instance)
I did cut this PR in 3 main patches, should we decide to partially apply these changes:
cl_function_types
cl_icd.h
which benefits a lot from the change. Given how suffixes are not really used (and very inconsistently incl_icd.h
) we could also take it a step father and remove the pointer type definitions from this file and use the function types directly inside the dispatch structure.For now I decided to minimize the scope of the changes. I did remove duplicated prototype declarations in cl_icdl.h, and added a missing guard aroundImplemented the change as suggested.cl_api_clCreateFromGLTexture
which apparently only exist in OpenCL 1.2.I tested using the ICD-Loader and CLHPP tests. No issues to report.