I’m trying to get a better handle on the added/new C++ support that Fermi brings to CUDA. In my opinion, the best way to do this is through looking at examples in the SDK, but I can’t seem to find any good examples of this. I know that the cppIntegration and FunctionPointers examples are intended to help with this, but they don’t seem to provide much in the way of intuition. So, I was wondering if anyone could recommend some good examples that show the new C++ support? Examples that show C++ support in general I guess are helpful too.
Is there a different forum I should be posting this in? Since I haven’t gotten any responses, I thought maybe someone could let me know if there’s a different Forum where this question might be more apt?
I’d think that “CUDA Programming and Development” is definitely the right forum for the question. I’m guessing that most of us just aren’t using the new c++ features and don’t have any ready examples. I know that I certainly don’t need on device virtual functions / function pointers or exceedingly slow on-device memory allocation for anything. I always look for simpler/faster solutions first (i.e. templates for inlined “virtual functions”, and allocating large overflow buffers within a single cudaMalloc instead of malloc/new on the device).
Appendix D of the CUDA C Programming Guide lists the supported C++ constructs with short bits of example code. Not all of the promised C++ support has been added to nvcc yet, however. For example, while CUDA 3.2 has an implementation of device-side malloc() and free(), those have not yet been rolled into support for the new and delete operators of C++.
Yeah, I saw Appendix D of the Programming Guide, that’s actually the first place I looked. However, as you said, those are just snippets. I was hoping to find actual full examples in the SDK so I could look through it more thoroughly. Have you seen any of those?