shm initialisation compiler and ptx guide disagreement

nvcc output:
initializer not allowed for shared variable
attribute((shared)) uint test[2] = { 0, 1} ;

PTX ISA guide:
.shared .f32 bias = {-1.0, 1.0};

Which speaketh the truth?


As I remember, Programming Manual states that shared memory cannot be initialized in such a way. PTX is another world, so it may be well possible there.

So, both may be true =)

and what does cubin say?

Yea, I was too lazy to try :D Here is the output of trying to use the following initialiser in a .ptx file.

.shared .b8 test[2] = {0,1};

ptxas /tmp/tmpxft_00001b5a_00000000-6.ptx, line 60; error : No initial value is allowed for ‘test’ in this storage class

So I guess the PTX guide tells porky pies. It would be nice though to have a way to initialise shm once per kernel call for each multiprocessor in certain circumstances.