How to make sure that inner loop in a nested for loop does not get parallelized? I tried to use “seq”, but somehow compiler seems to ignore it. What is a right way to use it? A sample code is given below.
#pragma acc region
{
#pragma for independent
for ( int i =0; i <outer; i ++) {
int temp = 0;
for ( int y=0; y<inner ; y++) { // make this loop execute serially
temp += array[y][i];
}
final[i] = temp;
}
}
Thanks for quick reply. I had also tried using “kernel”. Still the loop is parallelized by compiler. After your suggestion, I tried it without “independent” clause, but no use.