-
Notifications
You must be signed in to change notification settings - Fork 257
CL_VERSION_* define does not match specification #282
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
Comments
This commit provides definitions of builtins with the generic address space. One concept to consider is the difference between supporting the generic address space from the user's perspective and the requirement for libclc as a compiler implementation detail to define separate generic address space builtins. In practice a target (like NVPTX) might notionally support the generic address space, but it's mapped to the same LLVM target address space as another address space (often the private one). In such cases libclc must be careful not to define both private and generic overloads of the same builtin. We track these two concepts separately, and make the assumption that if the generic address space does clash with another, it's with the private one. We track the concepts separately because there are some builtins such as atomics that are defined for the generic address space but not the private address space.
According to the specification: > CL_VERSION_1_0 Substitutes the integer 100 reflecting the OpenCL 1.0 version Fix KhronosGroup#282
To be clear, I think it's fine to "fix" this, and it'd probably avoid confusion, but I believe the spec text is only for OpenCL C |
Oh, so those are undefined in the spec (on the host side)? |
Yeah, we currently don't say anything about these defines on the host, either in the OpenCL spec or even in this repo readme (debatably we should). If you're able to say, do you have a use-case for the defines with specific integer versions? Or was this just something you noticed and were surprised by? |
I don't have any issue with the current state. I was just surprised, and thought (wrongly) it should follow the OpenCL-C spec. |
I think the most problematic part here is that those are getting exposed to anyone including the header, but they are not mentioned anywhere in the specification. Should they be undefined somewhere? |
Cool, like I said previously, I'm fine merging your change to avoid even possible confusion. I've approved your PR. If there are no objections in tomorrow's teleconference let's just merge your PR. As far as documentation goes, maybe we could just add a short paragraph to the README, at least for now? Longer-term, we could consider adding some of this information in a spec appendix, similar to Vulkan: https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#_vulkan_header_file_version_number We could also undefine them somewhere, but IMHO they're useful, so it'd be better to keep them around and describe them instead. |
OpenCL-Headers/CL/cl_version.h
Lines 38 to 59 in 1ce4f1c
All
CL_VERSION_*
are defined bycl_version.h
to1
when not defined already. It does not match the specification:The text was updated successfully, but these errors were encountered: