Background

Prefetching code insertion has limitless possibilities because it is loading memory before it executes at any stage of your code. Computing every possibility would take an exceptional amount of time, and running every possible code would take even longer. We are trying to make this process easier by trying to define heuristics that might be found within different types of code.

We can model this with the use of prefetching pragmas which will be simulated as prefetches in the multi-core system.

Pseudocode example of prefetch pragmas:

Void memAccess(int* array) {
# Prefetch array[0:100]
For (int i = 0; i < len(array); i ++ ) {
array[i] = array[i] + 1;
}
}