Anyone working on STL for CUDA?

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).

Have a look at the thrust project:
[url=“Google Code Archive - Long-term storage for Google Code Project Hosting.”]Google Code Archive - Long-term storage for Google Code Project Hosting.

Sounds like something similar to your goals.

Have a look at the thrust project:
[url=“Google Code Archive - Long-term storage for Google Code Project Hosting.”]Google Code Archive - Long-term storage for Google Code Project Hosting.

Sounds like something similar to your goals.

Antogonistic, I have an antagonistic view… Trust Thrust is for host code. Not for device code.

Antogonistic, I have an antagonistic view… Trust Thrust is for host code. Not for device code.

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.

[url=“cuda_memory - Browse Files at SourceForge.net”]cuda_memory - Browse Files at SourceForge.net

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.

[url=“cuda_memory - Browse Files at SourceForge.net”]cuda_memory - Browse Files at SourceForge.net

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.