Forum Discussion
HRZ
Frequent Contributor
6 years agoThe compile automatically optimizes the number of banks based on the number of reads from and writes to the local buffers in your code. Writes are connected to all banks, while each read is connected to one bank. Hence, for example, if you have 1 write to and 4 reads from one buffer, without double-pumping, the local memory buffer will have four banks. Note that if accesses to a local buffer are consecutive, then the accesses will be merged into a larger access and will not increase the number of banks for that buffer; this is usually the case when you use SIMD or loop unrolling. In your case, the difference between the number of banks for the two buffers in your code is a direct result of the number of accesses to/from the buffers.