From the first look, I've few suggestions:
1. The issue may be due to lack of enough memory in the GPU. Please can you try with smaller problem size and observe.
2. It also may be a memory aligned issue, so instead of malloc, you can use aligned_malloc (or something) and check.
Please let us know findings of above experiments. If still problem exists, we'll try to look into details.
sorry for my late reply! I tried it with smaller problem sizes (128x128), but 512*512 shouldn't be too much under normal circumstances should it?!. For alignment, I am not sure where I use some buffer i would need to align. Iam not allocating a buffer that gets used by opencl. Iam only using the (opengl allocated) texture.
Has your issue been resolved? If not, could you please provide the program code? [It seems that http://pastebin.com/jUw6f42a link is not working]
FYI: You may refer the "GaussianNoiseGL" SDK sample which uses OpenCL image object created from OpenGL texture.