shared 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,

the first method is for when you do not know the amount of shared memory needed at compile time.

the second method is for when you do know the amount of shared memory needed at compile time.

This is explained in the Programming Guide 4.2.2.3 and 4.2.3