As we know, different processors perform better for certain types of workload. It would be nice to see a processing scheduler that could take advantage of this fact. Here’s my take on how this could work.
The first step into efficiently enabling this functionnality would be to determine on what type of processor the instructions would execute most efficiently. Think of this as a loose guideline for the scheduler. In order to achieve this, the compiler or a code profiling tool could examine the instruction set and rank the preferred order of each processor type for each instructions. For instance, instruction x processor ranking could be GPU, CPU, APU. Once the scheduler has this information in hand, it can then optimize processor usage based on various set of conditions and policies. Here’s a few example of such controls:
1) Processor availability: Is the preferred processor currently free to execute?
2) Processor consumption: Is it efficient power wise to execute this instruction set on the preferred processor?
3) Instruction set priority/deadline: Can this instruction set be executed on a non-optimal processor because it’s not running at a high priority or because there’s no execution deadline?
4) Instruction set parallelization: Can this instruction set leverage the parallelization features of the processors available?
5) Instruction set execution location: Can this instruction set be executed on a remote processor without adverse effects?
In order to achieve this, the compiler would supply the binary of a executable with the specific instruction sets targeting each processor type. Only the processor scheduler can determine at runtime on which type of processor a particular bit of code would execute.
This concept could work in a way that is similar to execution plans in database engine. As more statistics are gathered by the execution of the various pieces of code on the system, the scheduler could take smarter decisions as to how the code should be executed. The ranking of the processor could then be adjusted in the processor ranking manifest of the executable.
I think this could greatly enhance processor usage in all class of computers by offering alternate execution paths that were not dynamically available before. Right now, to take advantage of the available processor cycle of a specific type, one would have to rewrite the application to target it. The compilers and code profiling tools are good candidates at achieving those tasks as they already provide an abstraction layer from the targeted architecture. For example, the Intel compiler is able to target specific capabilities of the processor without having the developper to necessarily change a line of code. Programming language should stay what they are, a high level way to instruct the computer and all it’s resources to achieve a particular task. I think that targeting in code specific capabilities of an architecture is wandering away from the problem at hand to solve.