Ensure no alignment/padding mismatch between OpenCL kernel code and host code?

Viewed 10

alignment and padding are somewhat hairy subjects when switching platforms or even compilers - and even more so when programs on different platforms need to interact. Specifically, I'm worried about a data structure of mine which may get passed as a kernel argument, or many of it may be passed via a buffer, to a(n OpenCL) GPU kernel.

How can I guarantee my struct will have the same alignment and padding behavior on both the host and in my OpenCL kernel?

0 Answers
Related