... | ... | @@ -46,8 +46,27 @@ We would like to leverage taskiter to remove the overhead of task creation. Howe |
|
|
for (int token=0; token < T; token+=grainsize) {
|
|
|
#pragma oss task
|
|
|
{
|
|
|
#pragma oss taskloop
|
|
|
for ( /* innerloop */)
|
|
|
#pragma oss taskloop collapse(x)
|
|
|
for ( /* innerloop(s) */) {
|
|
|
/* We can have some other loops here */
|
|
|
/* calculations */
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
We will need to move to this kind of structure :
|
|
|
```
|
|
|
for (int token=0; token < T; token+=grainsize) {
|
|
|
for ( /* previous inner loops flatten in one loop */) {
|
|
|
# pragma oss task
|
|
|
/* calculations */
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
This way, we have transformed the outer loops and all collapsed inner loops into two loops, inside of it we launch a single task. This way we have removed the nested task by implementing the two task by hand.
|
|
|
|
|
|
NB : Currently, you can set the collapsed depth and grainsize in _ompss-2_wrappers.h_, however the grainsize is not as powerful as an ompss grainsize, as it applies only to the innermost flatten loop.
|
|
|
|
|
|
# Performances
|
|
|
|