-
Notifications
You must be signed in to change notification settings - Fork 236
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
Provide conversion functions between cl_half and other types #57
Comments
We should probably also provide |
+1 to this, and I can do the work to get the initial conversion functions into the headers. The functions in the CTS make extensive use of the |
That's great! Sounds good to me. I don't think we need/want to keep the functions exactly as they are in the CTS. I thought that we'd actually change the CTS to use the functions provided by the headers. The overall thinking was:
|
@jrprice #60 has done what I originally had in mind here. I've created KhronosGroup/OpenCL-CTS#870 so we don't forget to transition the CTS to these routines. Since you added tests as well under #60 I'm not sure there's anything left to do here other than creating new issues to cover making conversions automatic in C++ programs and consider adding all the |
No, the C++ sugar and |
We currently provide no host-side support for converting between
cl_half
and other integer or floating-point types.The following code snippet
results in a floating-point to integer conversion. This is really not nice.
While we can't make the above work in applications written in C, I suggest we provide conversion routines like https://github.com/KhronosGroup/OpenCL-CTS/blob/master/test_common/harness/imageHelpers.cpp#L898 as part of the headers. For applications written in C++, we could make casts work automatically.
The text was updated successfully, but these errors were encountered: