structures and global memory alignment requirement

Hello,

Given global memory alignment requirements, would mixed data type structures violate alignment requirements, regardless of whether align(8) or align(16) is used?

struct Struct
{
bool bool1;
bool bool2;
int int1;
int int2;
double double1;
double double2;
};

the compiler would automatically insert padding bytes inbetween struct members to satisfy alignment requirements.

NOTE: it is generally better to use structures of arrays over arrays of structures for
use with CUDA (with SoA you get coalescing for free, whereas it’s next to impossible with AoS…)

Christian

It is not really a SoA or AoS, but rather a CSrST (control structure referenced by a single thread)

There are just to many variables to pass them as kernel parameters, so I use structures to pass in the variables, from time to time

If the compiler adds padding, then the structure size on the device would differ from the structure size on the host, meaning that I can not simply use cudaMemcpy on the structure…?
I think I have read something along those lines in the programming guide