pyopencl
pyopencl copied to clipboard
Memory pools and multiple queues: missing synchronization
Suppose I run kernels in multiple queues, using memory pools to allocate output buffers for both. Currently, nothing is preventing a buffer from being returned to the pool before all kernels are done reading/writing it. Once it's in the pool, kernels from the other queues might pick up that buffer and overwrite it, with no synchronization to ensure that kernels from the first queue are done with it.
cc @vincentwells
This is a similar problem to #449. The approach proposed there can probably be reused here.
(We could declare this the user's problem to solve, but that feels fairly un-pyopencl'ish to me.)