cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spectral
Adept II

OpenCL equivalent to binary_cast

Does the OpenCL equivalent to "binary_cast<uint>(x)" is "as_uint(x)" ?

I need to convert a float to its "bits" representation to manipulate bits !

Thanks

0 Likes
3 Replies

use the as_* functions to do bitcasts in OpenCL.
0 Likes

Thanks Micah

0 Likes
Illusio
Journeyman III

Just in case anyone is interested... Some guys at Khronos have made a quick reference card for OpenCL linked below. I've found it quite useful for getting quick answers to generic questions like the above.

http://www.khronos.org/files/opencl-1-1-quick-reference-card.pdf

0 Likes