OpenCL struct values correct on CPU but not on GPU
问题 I do have a struct in a file wich is included by the host code and the kernel typedef struct { float x, y, z, dir_x, dir_y, dir_z; int radius; } WorklistStruct; I'm building this struct in my c++ host code and passing it via a buffer to the OpenCL kernel. If I'm choosing an CPU device for computation I will get the following result: printf ( "item:[%f,%f,%f][%f,%f,%f]%d,%d\n", item.x, item.y, item.z, item.dir_x, item.dir_y, item.dir_z , item.radius ,sizeof(float)); Host: item:[20.169043,7