pointers in CUDA something like root->child

I defined a struct in CUDA, for example, like this:
struct tree
{
int x;
int y;
};

Can I refer to the fields using notation like “root->x”?
Thanks!

It depends on where ‘root’ exists in memory. Pointers to shared memory are not allowed; global ones are OK.
Paul

Oops, that’s not true. Pointers to shared memory are fine:

“Pointers in code that is executed on the device are supported as long as the compiler is able to resolve whether they point to either the shared memory space or the global memory space, otherwise they are restricted to only point to memory allocated or declared in the global memory space.”
– Chapter 4.2.2.4 CUDA Programming Guide 1.0

Paul