Anything to add to Slicker's reply Jason?
Claggy
Sounds great. Perhaps just mention that any kind of exit, such as early exits or error outs etc, should be handled in such a way that the device gets its synchronisation before quitting... In the case of Seti it just meant handling 2 x early exit conditions & changing a macro used for error outs ( SETIERROR(...) )
That just makes sure that in every possible exit case (except hard terminateProcess() via task manager etc, which cannot be protected from), that there aren't any transfers or kernels in progress. My own implementation was semantically different to David's, but either way should be manageable as long as the process isn't killed underneath the working GPU.
[Edit:] for GPUs, IIRC they always fully exit on snooze, & a suspend message isn't used, but could indeed be something to double check if it needs handling as well.
Jason