Maiss
Maiss

Reputation: 1681

Relation between OpenCL memory architecture and GPU's physical memory/caches (L1/L2...)?

Is there any direct relation between the OpenCL memory architecture:

Local/Global/Constant/Private memory

And the physical GPU's memory and caches. For example a GPU card that have 1GB memory/L1 cache/L2 cache. Are these related to local/global.. memory?

Or are Local/Constant/Private memory allocated from Global memory? -Thanks

Upvotes: 4

Views: 1339

Answers (1)

KLee1
KLee1

Reputation: 6178

OpenCL doesn't really discuss caching of memory. Most modern graphics cards do have some sort of caching protocols for global memory, but these are not guaranteed in older cards. However here is an overview of the different memories.

Private Memory - This memory is kept as registers per work-item. GPUs have very large register files per compute unit. However this memory can spill into local memory if needed. Private memory is allocated by default when you create variables.

Local Memory - Memory local to and shared by the workgroup. This memory system typically is on the compute unit itself and cannot be read or written to by other workgroups. This memory has typically very low latency on GPU architectures (on CPU architectures, this memory is simply part of your system memory). This memory is typically used as a manual cache for global memory. Local memory is specified by the __local attribute.

Constant Memory - Part of the global memory, but read only and can therefore be aggressively cached. __constant is used to define this type of memory.

Global Memory - This is the main memory of the GPU. __global is used to place memory into the global memory space.

Upvotes: 5

Related Questions