- how to stop a program under execution?
- how to capture and store the state of a program that is currently under execution?
- hwo to restart a program by restoring the state of the program?
One possible approach:
You can’t reliably halt a running kernel.
The remainder of the code is host code. Therefore use whatever method you would normally use to do this with host code, and wait for any kernel launches to complete before switching to the next task.