How to directly output image array output image


I have a question.

I am implementing an image processing program in CUDA.

I want to ouput result image in device memory to some display device directly without passing through host memory.

The input array in my program is processed several times by various kernel function. so several output images are shown. And after making them into one image in device module, I have to output the result image to some display device directly.

can it be possible?

Thanks in advance.

Im not sure what you mean by “image”, but if you mean a bunch of vertices, then yes it is with the opengl interop operations. You create vexterbuffers on the global memory of the card, do your operations on them in kernel functions as if it was an array, and tell opengl to display it without moving it.

Unfortunately the operation to bind buffers is really slow. In my experience is it not all that costly to copy back and forth using memcpy and display the vertices through glpoints or something like that on the host.

Edit: see this thread for the performance issue i mentionned.

Checkout Mandelbrot example from SDK. Looks like it does exactly what you need.