I was reading through this article (very good article and excellent blog BTW) to do some measurements in my (very simple) implementation of the Mandelbrot Set.
I'm using a Quadro 2000D card which has a theoretical bandwidth of approximately 20 GB/s ( = 1304 MHz * 128 bit-bus).
Mandelbrot image has 700x700 pixels (uchar = 1 byte per pixel). Launching the kernel with a grid(44,44) and block(16,16) the time elapsed to compute it is 1.00026 ms.
Now if my calculations are good then I have the following
How should I interpret this result? I am only using approx 2.5% of the bandwidth, which is bad but since the algorithm is doing only a write per pixel there's no way to improve this, is there? Is there something I am not taking into account?
I did three types of kernels to see what was going on and reduced the size of the image to 250x250.
First the very naive, 1 thread doing all the work: 125 ms + 3.1% Global efficiency store + 2% occupancy. This is BAD.
Second, one thread per row: 0.20 ms + 97.7% Global store efficiency + 16% occupancy. Much better.
Third, one thread per element: 0.25 ms with 50% Global store efficiency + 55% occupancy. Worst than the previous.
So, from here what can I do to improve? Is there way to do it? The only thing it occurs to me in the third type is to write inside the kernel to shared memory, then synchronize and after that all threads write to global memory so to have coalesced accesses.