KhronosGroup / KhronosGroup/OpenCL-Docs
The right way to pack `cl_float` into `cl_sampler_properties`
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
In #931:
> Note that there is a weird potential mismatch between `cl_context_properties`, which is currently an `intptr_t`
It's already common, for the `cl_*_properties` list to accept types with different sizes.
For instance, `CL_CONTEXT_INTEROP_USER_SYNC` is followed by `cl_bool`, which is `cl_uint` with only 1 bit used. Well, it can just be padded with zeroes on 64-bit systems.
But now that I looked at it - there is an even weirder case:
https://man.opencl.org/clCreateSamplerWithProperties.html
`CL_SAMPLER_LOD_MIN` is followed by `cl_float`. But how is this `cl_float` converted to ~~`intptr_t`~~ `cl_ulong`?
- Bitwise? But that would be awkward when language without pointers uses OpenCL bindings.
- Rounding? But then why use `cl_float` in the first place...
Contributor guide
Research direction
Read issue #931 and the clCreateSamplerWithProperties reference linked in this issue, focusing on the cl_float value for CL_SAMPLER_LOD_MIN. Resolve how the value is represented in cl_sampler_properties and document the agreed behavior in the relevant OpenCL specification or reference material.
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