Hi Andreas, Thanks for your answer.
On 11/23/10 01:22, Andreas Kloeckner wrote:
I'm wondering whether we should default cl.enqueue_write_buffer's is_blocking to True, which would eliminate this whole class of problems. FWIW, I've been bitten by this same issue. Opinions? Ideas on how to do this without breaking API? (Rename e_w_b?)
I think the most elegant way would be to make cl.enqueue_write_buffer increase the reference count to the buffer used until the transfer has been completed. I assume, however, the transfer is handled by the OpenCL runtime and not PyOpenCL making this difficult if not impossible without a fairly large overhead. While defaulting is_blocking to True is a change in the API, it should work for most people. It might impact performance since the transfers aren't done in the background, but I don't see how it would break code. I think it would be a good idea. Jan ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDirig Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
