Suppose I have the following function:
void fun (){
#pragma omp parallel private(i, x, d0, d1)
{
#pragma omp for
for (i = 0; i < n; i++) {
d0 = calc_dist();
d1 = calc_dist();
x = ((d0 < d1) ? 0 : 1);
buffer1[i] = x;
#pragma omp atomic update
group_size[x] += 1;
}
}
}
I want to know if accessing buffer1 buffer1[i] = x is still private having the fact that i and x are set to be private variables in the pragma section? If not, is it possible to allow buffer access private?