Question about the shared memory

Hi ,

I am not clear about the description of shared memory and bank, and how variables are allocated in the shared memory, for example, I define the following structure and array of the structure:

struct myType {
float f;
char c;

shared struct myType myTypes[64];

the question is: how is the array allocated in the shared memory, or in which bank does every elements of the structure array reside?

Thanks in advance

Think of it this way:

  • arrays of strutures are laid out linearly in memory, in exactly the same as they are in C/C++.
  • the i-th 32-bit word in shared memory is assigned to i%16-th bank. For data elements smaller than the word, find which word the piece belongs to, and that’ll tell you in which bank it is stored.