Structure Padding or Memory Transferring
I have develop a C code to do some calculations on some data made of structures. It works perfectly on CPU with C code. I have then implemented the same code with OpenCL and it is outputting wrong results and by debugging on CPU I can see it's reading wrong values from the structures. I have developed different codes on OpenCl even big codes and didn't have this problem. I am using doubles to avoid precision differences but the problem here is that the data looks getting transferred wrongly. I have no idea why is this happening. What suggestions would you guys give me? I have done already structure packaging correctly I guess. Looks like the memory allocation might be giving some problems but I am not sure why. I am running just 1 work-item and no use of local memory only global. Before I was trying a similar code and it was not giving so many problems. I am thinking it's a problem of memory allocation but I have always done like this in other codes.
Sorry if I am not posting any code but I can't share it because of my job.