Re: Device lost possible?
I don't see any errors that are specific to you scenario, which makes me think that you could get any random error and that this will vary by vendor. CL_INVALID_DEVICE and CL_INVALID_PLATFORM might get generated when interrupting a function call that should not otherwise generate them, but that is real guess work on my part. The best strategy might be to retry a given operation a certain number of times with a delay in-between each retry. Re-initialising your platform, device, memory objects, kernels, etc. on the first error will also be needed.