Displaying data from OpenCL with OpenGL


I have some computing project written in OpenCL, kernel calculates solution of the system (2D) until stabilized.
Now, I want to show those steps in a window.
My advisor told me to allocate texture in GPU memory, than copy data from vector to texture in a kernel and before next kernel execution display this texture.
Is this the simplest way to do this or you have any other ideas ?
(I don’t want to rewrite whole project, just add this upgrade. I know that this probably isn’t most optimal solution, but it will serve only demonstration purpose).

Does Nvidia SDK or ATI SDK, have some code which can help me with it?
Or maybe you know any tutorial which may be helpful?
I will probably learn OpenGL in the future but know I want to just use it in the simplest way.


simplest way might be to use an available printf implementation and just print numbers/characters to a console.

Otherwise, depends on the data. if you have 2 dimensions of values, you could write the buffer to an image (write_imagef(…) or similar) and save each frame to disk (read it in and export a bmp with frame number, not too involved). If you want to see it interactively, you might as well go the OpenGL interop route however.

I would not advise using the printf functionality to transfer data. printf is a feature for debugging only.