Skip to content
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

The right way to pack cl_float into cl_sampler_properties #932

Open
SunSerega opened this issue May 23, 2023 · 0 comments
Open

The right way to pack cl_float into cl_sampler_properties #932

SunSerega opened this issue May 23, 2023 · 0 comments

Comments

@SunSerega
Copy link
Contributor

SunSerega commented May 23, 2023

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...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant