CUDA indeed supports not only operator overloading but also basic inheritance. anything “virtual” (derivations or methods) didn’t work with 1.0, but I think due to the lack of true function pointers on the device these don’t work with 1.1, too. i think most of C++ works, apart from everything that needs function pointers.
using C++ instead of C is basically nice, but be warned: multiprocessor resources are really scarce and for achieving good performance you have to break OO encapsulation.
i’m currently writing a ray tracer with CUDA and i got the following ray class for example:
for performance’s sake you should follow some mem alignment reqirements when loading a ray from device mem. so i did:
ray.o.x = dpRayOrigins[KERNEL_TID];
ray.o.y = dpRayOrigins[KERNEL_TID + KERNEL_SIZE];
ray.o.z = dpRayOrigins[KERNEL_TID + KERNEL_SIZE*2];
ray.tmin = dpRayOrigins[KERNEL_TID + KERNEL_SIZE*3];
ray.d.x = dpRayDirections[KERNEL_TID];
ray.d.y = dpRayDirections[KERNEL_TID + KERNEL_SIZE];
ray.d.z = dpRayDirections[KERNEL_TID + KERNEL_SIZE*2];
ray.tmax = dpRayDirections[KERNEL_TID + KERNEL_SIZE*3];
although one might think of a clean and elegant OO-way to wrap these lines, i guess you would have to spend a lot of time rewriting and restructuring your application to make things work fine with CUDA. what kind of application/program are you dealing with?