shared memory how use that memory

Hi,

Sometimes CUDA need a third parameter for shared memory, for example: example1 <<< griddim, blockdim, MEMORY>>>(d_a…);
but If we don’t put that parameter and then we use a shared memory: shared helparray[240];

What is the difference between? When I’ve use each method?

Thank you,

Allocate dynamic shared memory.

example1 <<< griddim, blockdim, MEMORY>>>(d_a…);

Allocate static shared memory.

shared helparray[240]