On Wed, 18 May 2011 10:51:00 -0400, Anthony LaTorre <tlator...@gmail.com> wrote:
> I have a question about when allocated texture memory is freed on the device
> by pycuda. Suppose I have a function which does the following:
> 
> >>> def foo():
> >>>     a = np.zeros(100, dtype=np.uint32)
> >>>     a_gpu = cuda.to_device(a)
> >>>     a_tex = mod.get_texref('a_tex')
> >>>     a_tex.set_address(a_gpu, a.nbytes)
> >>>     a_tex.set_format(cuda.array_format.UNSIGNED_INT32, 1)
> >>>     return a_tex
> 
> If I call foo() I get back the texture reference, but the device pointer has
> gone out of scope. Is it still safe to assume that memory is still available
> on the GPU?

Nope. Texture references provide 'life support' for arrays and the
module they're from, but not for device pointers.

HTH,
Andreas

Attachment: pgpOuL55dYkGF.pgp
Description: PGP signature

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

Reply via email to