On 11/04/2014 10:01 PM, Jeff Law wrote:
Communication between host and GPU is all done via some form of memcpy,
so I wouldn't expect this to be a problem.
They still need to agree on the layout of the structure.
That is guaranteed by the fact that structure layouts are fixed before
we write out LTO.
And assuming
it'll always be memcpy perhaps isn't wise. Consider the possibility
that one day (perhaps soon) the host and GPU may share address space &
memory.
Well, in that case such a target presumably wouldn't use this hook, or
the hook would be extended so that DECLs that live in the host address
space retain their alignment. But that's not the problem we're solving
today.
But again, if this just affects stack objects, then it shouldn't be a
problem.
It also affects global variables in GPU memory, but for nvptx this isn't
a problem either.
Bernd