On Wed, 31 Aug 2011 17:33:07 -0400, Anthony LaTorre <tlator...@gmail.com> wrote:
Non-text part: multipart/mixed
Non-text part: multipart/alternative
> I'm trying to understand how and when device memory gets freed. For example,
> look at this piece of code:

Looks fine to me--after all, PyCUDA relies on the Python garbage
collector to tell it when some chunk of memory is no longer needed. The
only slightly suboptimal thing is that there seems to be a reference
loop in GPUArrays, i.e. array -> device allocation -> array (?), so that
deallocation really has to wait until the GC finds it.

Also note that PyCUDA will run the GC if it encounters an out-of-memory
situation on the device.

If that's not good enough, you can also call

a_gpu.gpudata.free()

to manually free the memory.

HTH,
Andreas

Attachment: pgpJKzwg2njOT.pgp
Description: PGP signature

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

Reply via email to