I have a GPU code that, at each iteration, decides if the iteration can be offloaded to the accelerator. OpenACC come to be the best tool: