I’m working with a Tesla C1060. If I declare a variable to reside in shared memory as (e.g.) shared float array[32];
does this automatically determine that array[0] should be in bank 0, array[1] in bank 1, etc…then array[16] in bank 0, array[17] in bank1, etc.? Similarly, for:

shared unsigned short array[32];
would place array[0] and array[1] in bank 0, array[2] and array[3] in bank 1, etc.?

And to beat a dead horse: shared unsigned char array[32];
would place array[0] through array[3] in bank 0, array[4] through array[7] in bank 1, etc.?

Assuming my understanding is correct, what shared memory layout would the following produce: shared float array_one[33]; // 33 is not a typo. shared float array_two[32];

array_one[32] would reside in bank 0. Would array_two[0] then be placed in bank 1, or does the layout default back to placing the first element in bank 0 (for different variables)? I guess a more direct question would be: is ALL shared memory placed contiguously, regardless of what variable each element refers to? Thanks for any input!

array[0] will not necessarily be in bank 0, but this does not really matter. Per C conventions all arrays are placed contiguously in memory. So if array[0] ends up in bank n, array[1] will end up in bank n+1 (mod 16), and array[i] in bank n+i (mod 16). This is all you need to know regarding bank conflicts.

array[0] and array[1] in bank n, array[2] and array[3] in bank n+1 (mod 16)

array[0] through array[3] in bank n, array[4] through array[7] in bank n+1 (mod 16).

array_one[0] and array_one[32] would reside in bank n, array_two[0] in bank n+1 (mod 16). All shared memory is placed contiguously, unless you ask for it to be aligned (using [font=“Courier New”]align(n)[/font]).

array[0] will not necessarily be in bank 0, but this does not really matter. Per C conventions all arrays are placed contiguously in memory. So if array[0] ends up in bank n, array[1] will end up in bank n+1 (mod 16), and array[i] in bank n+i (mod 16). This is all you need to know regarding bank conflicts.

array[0] and array[1] in bank n, array[2] and array[3] in bank n+1 (mod 16)

array[0] through array[3] in bank n, array[4] through array[7] in bank n+1 (mod 16).

array_one[0] and array_one[32] would reside in bank n, array_two[0] in bank n+1 (mod 16). All shared memory is placed contiguously, unless you ask for it to be aligned (using [font=“Courier New”]align(n)[/font]).