I was just about to begin the rite-of-passage Mandelbrot program in CUDA, when I thought about the best way to actually draw the thing.
Without CUDA, I usually use SDL (a wrapper for OpenGL) to draw the pixels, but it occurred to me that since the final data is already in the GPU’s global memory, and that everything pixel-related goes to the GPU anyway as the final step, how nice it would be to get code inside the kernel itself to plot the pixels. Otherwise, it means, transferring the picture data back to the host, and presumably, back again to the GPU. Such a waste of time.
Is this possible? Maybe I’m being naive here. I essentially have a 24-bit colour 2D array of memory representing pixels on the GPU, and would like the GPU to display that memory as a picture (in a window preferably), and eventually as a (realtime) animation without any worries of slowdown.
Maybe I can still use SDL?