The application either crashed in clBuildProgram trying to read from address 0x10, or gave garbage when referencing members in the struct. Calling sizeof() on the two structs, one in host code and one in device code, gives different sizes.
What is the correct way to pass a struct like this, or is the only option to send the members one by one?
I haven’t tried this with OpenCL, but I believe you just need to do some marshelling. Just allocate gpu memory for each of the pointers in your host struct and then copy this struct to the gpu.
cl_mems are objects that track an internal representation of the data. You can’t pass them in to the GPU as they aren’t pointers. (Technically they’re pointers to an object, but they are not pointers to the data.) The only way to access a cl_mem from within a kernel is to pass it in as an argument via setKernelArgs. Even if they were pointers, you’d have problems because the GPU and CPU address spaces are different, so they wouldn’t even point to the right place.