Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

memory

gpu

opencl

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

like image 356
Maiss Avatar asked Oct 31 '25 13:10

Maiss


1 Answers

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.

like image 144
KLee1 Avatar answered Nov 04 '25 03:11

KLee1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!