I am using the CUDA Toolkit 2.3 and just to try it out, I passed a class instead of a struct to a global function of CUDA. It seems to work fine as long as I declare all member-functions as host device. It is even taking care of the private and protected parts. :)
The only thing that is not working seems to be the destructor. Whenever I try to add one the compiler complains
myCUDAtest.cu:85: error: incompatible type for argument 2 of â€˜__device_stub__Z6kernelPi4Testâ€™ In file included from /tmp/tmpxft_00003f32_00000000-1_myCUDAtest.cudafe1.stub.c:6,
Is there a way around this or do I have to wait for the next Toolkit releases?