Andreas, thanks, but it currently implies Linux, I'll see if I can
make it work on Windows. Or maybe I'll submit and someone will try it
on Windows. I just need to extract it from Sage into a plain Python
script. Give me a couple of days.
On Thu, May 24, 2012 at 10:39 AM, Andreas Kloeckner
On Thu, 24 May 2012 09:54:15 +1200, Igor
From within Python, you can make a string
containing your C++ code
that uses thrust, save it to file, invoke nvcc to build it as a
library. Then use ctypes to load it and get the handle to the
The function can accept a device pointer. Then, suppose you've done
some work using PyCUDA. Get the GPU pointer and pass it to the
function -- no memory copying occurs here. Call the function letting
thrust do its stuff inside there and the output can be a device
pointer again or whatever.
That's the way I combine the two great libraries PyCUDA and thrust.
Tell me if it sounds suitable and I'll send you an example.
If you wouldn't mind contributing an example for the wiki, I'd be very
happy to add it. :)