Re: safe deleting cpu data
You have to use events, or some other mechanism which synchronises the calls (e.g. job completion).
All the 'enqueue' commands - not surprisingly - only enqueue requests, they do not wait for anything. The only guarantee is that the copy will be finished before the kernel is executed: but neither has any synchronisation relation to the host code (enqueue calls).
I tend to allocate all buffers necessary for a task and keep them around until i'm well and truly done. Or use events to arbitrate.
You could use event callbacks or a cleanup thread (which synchronisly waits on the events) if you want explicit control.