Enabling Legacy Applications on Heterogeneous Platforms