Parallelization & checkpointing of GPU applications through program transformation