Inconsistent Run Behavior

Hi all,

I have created my own OpenCL implementation for FFT. The problem is that sometimes it runs correctly and displays correct output, at others not. I don’t change any parameters to the program, and simply try to run it after gaps of 2 or 3 seconds.
I don’t know where to start looking to fix it. Any pointers?

If it may help, I am running on GTX 260 using NVIDIA drivers 260.19.26.

Omar

Random behavior like this is often caused by missed synchronizations somewhere. Look for places where you might need a barrier in your kernel code, and if you run multiple kernels in an out-of-order queue, look for missing dependencies between kernels.

You say the result may vary if you run the program multiple times. Can the same happen if you run the data initialization/kernel execution multiple times withing the same program launch? I.e., do not redo the platform/device/kernel setup and memory allocation but put the data initialization/kernel execution/result verification inside a loop.

this type of problem might occur if the output buffer takes junk values , initialize your output buffer to zero in the begining of the program

this type of problem might occur if the output buffer takes junk values , initialize your output buffer to zero in the begining of the program