You have two more pointers in the code using dynamic shared memory…
If you really care, you could check the generated ptx assembly. On the other hand, before worrying too much I’d check how much speed you actually lose with less then 100% occupancy. I believe achieving 100% occupancy is often overvalued, beyond about 2/3 or so the gain often becomes marginal.
No - syntactically you can use them as pointers, but no actual pointers are defined by these statements (you cannot assign values to them). And the compiler should resolve these these to constant addresses in memory.
These are two actual pointers, yes.
The discussion is slightly complicated be the aggressive optimization the compiler does. But the compiler cannot know beforehand with which value of [font=“Courier New”]pipesize[/font] the kernel will be called, so it cannot optimize the pointers away. You might try what happens if you replace [font=“Courier New”]pipesize[/font] with a constant in the pointer calculations.
Yes, you can insert inline assembly using [font=“Courier New”]asm()[/font] statements, although I don’t see how that going to help here. What I wanted to suggest was running nvcc with the -ptx flag and looking at the differences of the two kernels.