On Thu, 24 May 2012 09:54:15 +1200, Igor <rychphd(a)gmail.com> wrote:
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
function.
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. :)
Andreas