Freddie Witherden <[email protected]> writes: > On 05/11/13 23:30, Andreas Kloeckner wrote: >> Rok Roškar <[email protected]> writes: >>> wow that makes it pretty straightforward, thanks! >>> >>> I'm afraid I'm probably missing something obvious, but is there a similar >>> trick for streams? >> >> Nope, sorry. Patches welcome, although having this functionality is >> somewhat risky: A plain integer pointer-like value is not sufficient to >> tell Python that the object is still in use--it may thus get >> garbage-collected. > > In [3]: s = cuda.Stream() > > In [4]: s.handle > Out[4]: 32994256 > > Works a treat; although you do need to ensure that a reference to the > object is retained. Saying that, it is no more risky than having to > manually manage a stream using the C API. I've been using the above in > my ctypes cuBLAS wrappers for a while now.
Oh, I had forgotten about that! Thanks for pointing it out. :) Andreas
pgpKDabMo2L4f.pgp
Description: PGP signature
_______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
