dumb, newbie CUDA texture question

Ok, requisite dumb newbie quesion: The interaction of CUDA with textures is unclear to me from the programming guide. Questions:

a) Is “texture memory” distinct from either “global” memory or “shared” memory?

B) If so, does binding a texture reference to a piece of memory involve moving that memory?

c) why I would want to interact with something as a texture when programming in CUDA (as opposed to a CUDA array)? Are the texture-related functions in the API simply for compatibility with openGL and directx, or is there something you can do with textures that you can’t do with a CUDA array?

If someone could clarify this, I would be most appreciative.



shared memory is high-performance on-chip register memory, limited in size. Global memory is uncached off-chip DRAM memory. Textures units are sort of hardware interface, built on top of global memory. They do caching and filtering in the same way as in graphics and compared to “raw” global memory do not impose rather tight restrictions on access patterns, required for best performance, only 1D/2D data locality. You can bind texture reference either to “raw” linear global memory address or to a CUDA array. CUDA array is an opaque data storage, which you can only memcpy to/from and bind to a texture reference. No data moving is involved when binding data storage to a texture reference, so it shouldn’t be a concern. For limitations and differences between CUDA arrays and linear memory with respect to texturing please refer to the Programming Guide.


Thank you…that’s a bit clearer. My problem, I think, was mostly that I somehow missed the section on texture fetching. It seemed like there wasn’t anything you could do with a texture reference! :)