- Does OpenCL local memory really exist on Mali/Adreno GPU or they only exist in some special mobile phones?
- If they exist, in which case should we use local memory, such as GEMM/Conv or other cl kernel?

- 145
- 6
-
For Mali6xx, local memory does exist and it's allocated in the cache. Don't know about the later versions. – SK-logic Mar 24 '22 at 09:37
2 Answers
Interesting question. OpenCL defines a number of conceptual memories including local memory, constant memory, global memory, and private memory. And physically as you know, the hardware implementation of these memories is hardware dependent. For instance, some may emulate local memory using cache or system memory instead of having physical memory.
AFAIK, ARM Mali GPU does not have local memory, whereas Qualcomm Adreno GPU does have local memory.
For instance below table shows the definition of each memory in OpenCL and their relative latency and physical locations in Adreno GPU cited from OpenCL Optimization and Best Practices for Qualcomm Adreno GPUs∗
Answer updated:
as commented by SK-logic below, Mali6xx have a local memory (shared with cache).

- 1,499
- 2
- 10
- 25
-
-
@SK-logic: thanks a lot for the feedback. Can you please provide me some resource to read? I am also curious since I did not know it. I will then update my answer :) – BZKN Mar 24 '22 at 11:46
-
1I'm not sure there's a lot of public resources on mali6xx opencl implementation. I only know these details because I was a part of the team that wrote the driver. One way to demonstrate it is to benchmark local memory access. – SK-logic Mar 24 '22 at 15:06
-
@SK-logic. fair enough. I have updated my answer so that it is helpful for the OP and as well for others who come across such question. – BZKN Mar 24 '22 at 15:29
-
@SK-logic,Mali6xx have a local memory (shared with cache). Where is the cache on Mali6xx? Do you mean it is the on-chip memory? – irasin Mar 29 '22 at 08:51
-
Ok, I double-checked the current state, and looks like since the early OpenCL implementation the functionality of locking L2 area for local storage was removed. In the current implementations there is no difference between local and global storage besides the sync primitives. – SK-logic Mar 30 '22 at 10:12
Memory is shared on recent Mali, not local, but OpenCL still has the concept of the memory being separate, so there are special commands to make sure there is no copying. Use of private/local memory is not recommended.
For more information on best use of memory with Mali OpenCL, please read:

- 338
- 2
- 12