Texture memory when to use ?

Hi,

Can any one please tell me what are the uses of texture memory, especially in non-graphical applications. I know in graphical applications it can be used for storing small amount of data corresponding to a surface (which is replicated in the background in actual application, when it is run).

Thanks in advance for your precious time

1 Like

TextureMemory is cached and read-only. That are the differences to global memory. So use it if you need random access to a larger memory space that cannot be put into shared memory.

In CUDA, there is no such thing as “texture memory”, just “textures”. The GPU has a lot of real estate tied up in very fast 1D, 2D and 3D filtering/interpolation units (with cache) for texturing during rendering. The can be used in CUDA as a (usually) faster than global memory read-only data source inside kernels, as well as for filtering/interpolation. The memory itself is just regular old global memory, and the extra speed comes from the cache and the spatially optimal data storage format the texture unit uses.

You mean textures are some kind of computational units for performing filtering/interpolation?

No. In the context of CUDA, textures are the mechanism by which data is retrieved through those computational units inside kernels running on the shader hardware.

But the figure attached here taken from CUDA Best Practices Guide on page number 29, says that texture are memory and have some space as cache. Please see the attached file

1 Like

You might want to read my original reply in this thread. To recap

    [*]There is no dedicated texture memory in current architectures. Textures are stored as global memory which is bound to a given texture reference. CUDA provides an API for this.

    [*]The texture units have a small read cache, and that cache often provides some speed up over reading from global memory, although cache misses can hurt performance depending on the spatial organization of the data bound to a texture and access patterns.

    [*]Texture references provide a method for CUDA kernels running on the shader cores to transparently fork texture unit threads and access data bound as textures. This data access can include filtering and interpolation, and as of CUDA 2.x can be done in 1D, 2D, or 3D.

Any clearer?

2 Likes