-
Notifications
You must be signed in to change notification settings - Fork 117
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
Clarify on Comparability & Uniqueness of OpenCL Objects #797
Comments
Very minor editorial suggestions (one of these is not new):
|
Since PR #802 is merged I think we can close this now? |
Yes. What about CTS coverage? |
Good question. We should either add it, or add a CTS issue so it's less likely to slip through the cracks. |
I added KhronosGroup/OpenCL-CTS#1485 to track CTS coverage for this update. |
In the current version of the OpenCL specification, there is no guarantee on the comparability of two OpenCL handles. It seems that in typical implementations, a handle is simply a pointer to an internal structure containing the particularities of the object, and so in practise comparing two handles for equality will yield the desired results. Technically, however, an object could have multiple handles that internally map to the same object. This case is of particular interest in
clGet*Info
calls which fetch a handle to the parent of the object, allowing the implementation to return a handle with a different value. For instance, this makes it unclear if the following snippet is valid at all, and what the result should be:Assuming that object handles are indeed comparable, and that each object should have a unique handle during its lifetime, the issue of reusing handles comes up. For instance, the following snippet is invalid, but releases
ctx_b
in some implementations:While these issues are not very significant for the validity of typical OpenCL programs, clarifying them should serve to help improve diagnostic layers that catch issues in invalid programs. Therefore, we propose the following wording:
Handle
in chapter 2 (Glossary):The text was updated successfully, but these errors were encountered: