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.
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.