On 05/11/13 23:30, Andreas Kloeckner wrote:
> Rok Roškar <ros...@physik.uzh.ch> 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.

Regards, Freddie.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to