pyopencl icon indicating copy to clipboard operation
pyopencl copied to clipboard

Memory pools and multiple queues: missing synchronization

Open inducer opened this issue 3 years ago • 2 comments

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

inducer avatar Mar 19 '21 06:03 inducer

This is a similar problem to #449. The approach proposed there can probably be reused here.

inducer avatar Mar 19 '21 06:03 inducer

(We could declare this the user's problem to solve, but that feels fairly un-pyopencl'ish to me.)

inducer avatar Mar 19 '21 06:03 inducer