KhronosGroup / KhronosGroup/OpenCL-Docs
Clarification required regarding generic pointers inside structs stored in global memory
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
With OpenCL 2.0 it is valid to have a struct containing a generic pointer. It is also allowed to store such a struct inside global memory.
With fine grained system SVM it is also allowed to pass pointers to global memory through structs being kernel parameters and I don't see anything in the spec stating such a pointer can't be a generic one (see #10 for this issue in particular).
Now things are starting to get interesting if a struct with a generic pointer is stored inside global memory. In some cases the actual address space needs to be stored within the generic pointer, which might mean that more space is required than reported by CL_DEVICE_ADDRESS_BITS.
Also when setting the value of a generic pointer on the application side, the application would have to know how to encode the address space as well.
Should generic pointers inside global memory be disallowed by the spec or would it be better to have a more explicit size of generic pointers to deal with this situation?
Contributor guide
Research direction
Read the OpenCL 2.0 specification sections on generic pointers, structs, global memory, fine-grained system SVM, and CL_DEVICE_ADDRESS_BITS, then review the related issue #10. Done means reaching and documenting a resolved rule on whether generic pointers in global-memory structs are allowed and how their representation and application-side encoding are specified.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100