images and memory access optimization


I have a newbie conceptual question about memory optimization when working with image data types.

I’ve read through a number of tutorials about the importance of coalescing global memory accesses and avoiding bank conflicts when accessing local memory. But when I’ve looked at the samples that use image data types, I don’t see any of these optimizations; I just see global memory being accessed directly through the image functions.

Is this strictly an artifact of the small local memory sizes relative to the size of most image data? Is it possible to still get some gains by loading chunks of image data into local memory when there will be multiple accesses to each pixel (as is the case for my application)? Or am I just overcomplicating things?

Thanks in advance,


Images on today’s hardware have caches, so you get most of the benefits of local memory without the difficulty. The caches are small (~32kB L1, ~768kB L2) so you need a lot of locality to make it work.

Writing to images is very slow. Avoid it if you can.


I appreciate the instructive reply. Your explanation makes perfect sense.