inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.04k stars 239 forks source link

SVM `bind_to_queue` and `unbind_queue` cannot be safely used #645

Open inducer opened 1 year ago

inducer commented 1 year ago

Since they modify the allocation in place, they're unusable e.g. in the array. Consider the expression ary2 = ary.with_queue(None), which one might think should unbind underlying SVM from the queue. But ary is still ailve, and both ary and ary2 refer to the same allocation.

Instead, we need some sort of "holder" object that inserts a queue into a list of queues that need to be synchronized with when freeing the SVM.

cc @matthiasdiener