Reputation: 2741
How are constant memory and texture memory implemented in GPU? I know that device memory is off the streaming multiprocessors and is a DRAM. Shared memory is on-chip, and probably an SRAM.
I also read somewhere that parameters are passed to the kernel via constant memory (i.e., parameters to the kernel function are copied from the CPU to the GPU constant memory). Is this correct?
Upvotes: 3
Views: 1417
Reputation: 3127
Texture memory and constant memory are allocated in the off-chip memory used by global memory, but accessed via dedicated hardware. Both memories have their own cache space (quite small) and special features like 2D pre-fetching for 2D texture memory or broadcasting for the constant memory.
Kernel parameters are stored in constant memory in Fermi and Kepler GPUs, on older G80/90/200 GPUs they are stored in shared memory.
See the CUDA C Programming Guide for more details about the caches sizes and those special features.
Upvotes: 5