1. A method for accelerating processing of program code in a heterogeneous system comprising different execution units, the method comprising: identifying at runtime of the program code a code region in the program code, wherein the code region has an acceleration potential which is determined based on a trigger; creating a dependency graph of the program code of the code region; expanding the dependency graph based on a first set of predefined rules, thereby generating variants of the code region; determining segments within each of the variants of the code region within the expanded dependency graph based on a second set of predefined rules, wherein each of the segments is assignable to a specific one of the execution units; selecting the segments out of the variants such that a set of selected segments is equivalent to a program code functionality of the code region, and wherein a total cost function for an execution of the set of selected segments is minimized; compiling the set of selected segments at runtime of the program code; and assigning each segment of the set of selected segments to a respective specific one of the execution units.