Now that Cuda 3.2 should have malloc and free, I can see that it is easier to implement some of the STL. I can do some of it myself but I would like to know if anyone is going to do it (nvidia, users, etc).
What I would do is:
enter libstdc++ in the gcc source code, extract the bits/* and stl headers I wanted. Edit the source, remove anything incompatiable (like RTTI, or c++0x stuff). Then make a cuda header file. I would do: vector, map, set, multimap, unique_ptr (autoptr).
I put up my memory management class on source forge not too long ago that behaves somewhat similar to a vector (it does 2 dimensional device arrays as well, and I’m working on an OpenCL version too). I’m also working on what sounds like your idea, creating STL device code with kernels.
I put up my memory management class on source forge not too long ago that behaves somewhat similar to a vector (it does 2 dimensional device arrays as well, and I’m working on an OpenCL version too). I’m also working on what sounds like your idea, creating STL device code with kernels.
hi scwizzo, that’s rather compact :) let me see if it works for me and i’ll let you know…
implementing all of stl might be a bit burdensome, i think that the current code path separation is flawed, it would be much better if the compiler generated both device and host codes for any function, requiring the specifiers global and device is… a bit redundant for every function. It would be much better if that was automatic and if a C++ API was provided.