I got a segfault in clEnqueueReadBuffer reading the result of a kernel. I run my kernel a first time w/o problems and then I exchange the variables and run it again where it crashes with a segfault. But the behavior is not ‘perfectly reliable’. Sometimes it works in debug mode but not in normal mode, but most of the time it does not work at all. So I assume it is a memory issue. I checked all the variables that go in and out of clEnqueueReadBuffer regarding their sizes, but I could not find an error. Where else could the error hide? How would you debug this error?
Thank you very much!
[codebox]_err = clEnqueueReadBuffer(GPUCommandQueue, z_cl, CL_TRUE, 0,sizeof(float)*nclasses,h_c3, 0, NULL, NULL);[/codebox]