I am currently doing the following to access my shared memory:
extern shared in sdata;
extern shared unsigned int usdata;
Now I have two declarations because I want to access fields as ints in one situation and unsigned int in another. Does this setup work without problems? Are the two declarations treated as pointers to the beginning of the shared memory? Is there a better way?
I never tried to have more than one extern and I think it is potentially dangerous as I don’t know how to tell the runtime how to bind the extern to the shared mem argument of the kernel launch. It is done somehow, so you better stick to the solution in the manual, that is do one extern and cast appropriate pointers.