Buffers destroyed too early in some ViennaCL cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocl |
Fix Released
|
High
|
Unassigned |
Bug Description
OpenCL 1.2 Page 118:
After the memobj reference count becomes zero and commands queued for execution on a command-queue(s) that use memobj have finished, the memory object is deleted. If memobj is a buffer object, memobj cannot be deleted until all sub-buffer objects associated
with memobj are deleted.
Some ViennaCL cases crash if the freeing of buffers is enabled in clReleaseMemObj
It could be enough if all the queued commands that use buffers (enqueue, map, read/write, copy, ..) retain the buffers they use and after finishing execution in clFinish release it. In ViennaCL case I think the crash was due to a buffer copy operation which didn't retain the src&dst buffers.