For example, I have this code:
// ...
for (int i = 0; i < 5000; ++i) {
for (int j = 0; j < 7000; ++j) {
// Do something...
}
}
// ...
Can I change it using annotations? If yes, how I can perform it? Something like this:
// ...
@SplitFor(value="i < 2000, j < 3000")
for (int i = 0; i < 5000; ++i) {
for (int j = 0; j < 7000; ++j) {
// Do something...
}
}
// ...
Should translate to:
// ...
for (int i = 0; i < 2000; ++i) {
for (int j = 0; j < 3000; ++j) {
// Do something...
}
}
// ...
It possible? If yes — HOW?
P.S.:
This is can used for easy parallelization: I can generate split loops for used it in Fork/Join framework, for example.
Typically, you’d do this in one of two ways: