Take the 2-minute tour ×  After allocating a VBO using OpenGL I
create an OpenCL buffer from it using clCreateFromGLBuffer.  I
use the VBO as an array of GLfloat and the OpenCL buffer as an
array of cl_float. It works perfectly on my machine. Indeed,
GLfloat and cl_float (and float) have the same size.  I am
wondering if this would work anywhere flawlessly. In other
words, is sizeof(GLfloat) == sizeof(cl_float) always true?* And
if not, how does one usually deal with this?  * and is there
documentation proving this  share|improve this question add
comment  1 Answer  up vote 3 down vote accepted  Yes, if you
check out the CL and GL headers, you get:  typedef float
cl_float;          // @cl_platform.h typedef float GLfloat;
// @gl.h  Note in some GL implementations you get intermediary
typedef's like khronos_float_t but ultimately it all boils down
to the float type. So both types are identical to your native
float type. Furthermore, the equivalent data types in OpenCL
kernels and OpenGL shaders are b