shared memory allocation among thread blocks

Dear All

If i have a thread block that uses a quarter of the shared memory and more than four thread blocks does this work ?



I think a block can use nearly whole shared memory of size 16KB, but the parameters d1, d2, … (sizeof(d1) + …<=256B) of


will pass to device by shared memory, so the maxsize a block can used is <16KB.

In a word, shared memory on a multiprocessor belongs to one block at least.

BTW, the processing of blocks can be serial according to whether a block can get the computing resource, including shared mem, register, etc.


Thanks, the Occupancy calcualtor also implies this.


I think not, I believe that blockDim, gridDim and blockIdx are shared variables. You can search the forum for a post of wumpus where he explains all the automatic shared variables he found. parameters to the kernel are stored in registers. (also threadIdx.x is automatically placed in register0)