Home Knowledge Base GPU Texture and Constant Memory

GPU Texture and Constant Memory are specialized GPU memory spaces with dedicated caches — optimized for specific access patterns that offer higher effective bandwidth than global memory for appropriate workloads.

CUDA Memory Hierarchy Summary

MemoryScopeCached?Bandwidth
GlobalAll threadsL2~900 GB/s
SharedBlockOn-chip~19 TB/s
TextureAll threadsL1 tex~900 GB/s + spatial cache
ConstantAll threadsConst cacheBroadcast
LocalThreadL2Slow

Texture Memory

Texture Example

texture<float, 2, cudaReadModeElementType> tex;
cudaBindTexture2D(0, tex, d_data, channelDesc, width, height, pitch);

__global__ void sample_kernel() {
    float val = tex2D(tex, u, v);  // Bilinear interpolation included
}

Constant Memory

Read-Only Cache (__ldg)

Texture and constant memory are specialized caches that provide free speedups for specific access patterns — image processing kernels using texture memory can achieve 2-4x better cache hit rates than equivalent global memory accesses on spatially correlated data.

gpu texture memoryconstant memoryread only cachecuda texturecuda cache

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.