Hi Kunal,

On Sat, 16 Apr 2011 12:10:30 +0530, Kunal Puri <[email protected]> wrote:
>    I have a particle system (http://pysph.googlecode.com ) that I want to
> integrate in time. At the start of the simulation, I allocate all the
> particle properties on the device. After the integration step, I read the
> contents of the buffer back into the numpy arrays on the host. If the number
> of particles remain the same, I have no problem. But if I use a load
> balancer on a bunch of machines, then the number of particles per machine
> varies and I need to reallocate memory on the device.
> 
>  My question is, is there a way to de-allocate device memory in PyOpenCL? Or
> am I supposed to allocate sufficient memory at the outset?

It sounds like you are asking whether you can allocate/deallocate memory
within a kernel. The answer to that is "no". OpenCL does not allow
that. (CUDA does, but it's quite inefficient.) You may use PyOpenCL's
'scan' or 'reduce' implementation to count up your memory needs ahead of
time, which is likely going to be much faster.

If I misunderstood you, please ask again.

Andreas

Attachment: pgpZeZRa8HLOZ.pgp
Description: PGP signature

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to