I’m trying to start using shared memory but I have to clear some problem using it.
For what I understand , shared memory is the memory shared between thread inside a block.
I can declare it in launch like this (for example):
int sh_Size = 1000 * sizeof(int); launchKRN<<< grid, threads, sh_Size >>>(d_srcArray);
These are my questions about these lines:
shared memory Size must be lower than 16 kb?
the 16 kb max size dimension for shared memory is referred to the total shared memory on the device to use or to the single block shared memory size?
(If I declare 4 blocks, I have sh_Size shared memory dimension or 4 * sh_Size?)
when I declared the third parameter in launchKRN (sh_Size) it is referred to:
A ) the size of the total shared memory on the device that I want to use ?
B ) the size of the shared memory for block on device ?