I'm studying PTX and I don't understand the difference between .param
and .local
state spaces.
.local
are variables visible to threads and stored on their stack (which is, by the way, thread memory)
.param
are variables used for object allocation (if passing by value), function parameters and return values and input parameters and they're also allocated on the stack
On the PTX manual there's:
In PTX, the address of a function input parameter may be moved into a register using the mov instruction. Note that the parameter will be copied to the stack if necessary, and so the address will be in the
.local
state space and is accessed viald.local
andst.local
instructions.
I don't understand: why copying a .param
to the stack if .param
== .local
and everything is already on the stack?