smem usage and kerenel params

I’m sorry if this has been addressed elsewhere. I wasn’t able to find a topic with the answer I’m looking for. When you use [font=“Courier”]ptxas -v[/font], and get output like:

ptxas info    : Used 2 registers, 20+16 bytes smem, 4 bytes cmem[0], 4 bytes cmem[1]

What does 20+16 bytes smem mean? What are the two numbers? From experiments it looks like the first number starts at 16 and goes up by the size of parameters. The second number seems to go up similarly but only if you add new parameters. The second number too starts at 16. Is 16+16 bytes the overhead required for having kernel parameters?

When I call cuSetSharedSize() must the number I provide be at least as big as 20+16 (for my example above)? I’m using cuSetSharedSize for situations where my kernel uses shared memory like so:

.extern .shared .b32 mem[];

.entry main

{

...

}

I’ll continue my experiments and post results here but in the meantime if anybody has anything to add I’d be happy for the info.