Structures in CUDA structures and shared memory

Hi,

If a structure is declared with the key word shared i.e. intending to keep it in the shared memory, would all the elements of the structures be placed automatically in the shared memory?
e.g.
shared MyStruct MyData;

where MyStruct is defined as
typedef struct
{
int i;
int* j;
int k[1024];
}MyStruct;

Appreciate your help, thanks

Yes.

So in your example, there really is a big chunk of sizeof(MyStruct)=4104 or 4108 bytes laid out in shared memory.

Yes.

So in your example, there really is a big chunk of sizeof(MyStruct)=4104 or 4108 bytes laid out in shared memory.

Exactly, and you can acces eache elemnt like this:

//inside de kernel

MyData.k[threadIDx.x]= …;

Exactly, and you can acces eache elemnt like this:

//inside de kernel

MyData.k[threadIDx.x]= …;