Questions about "data" clause and "parallel&q

  1. Firstly, for example,
    if you ran code like

#pragma acc parallel loop
for (…) {

for (…) {
}

}

Without any directive ahead of the inner for loop, will the compiler tried to automatically
parallelize this loop ?

  1. What should I do if I want to declare an array A as private for each thread ?
    Just add private(A) would work or should also create space by using copy|create ?


    Thanks.

Without any directive ahead of the inner for loop, will the compiler tried to automatically parallelize this loop ?

The PGI compiler will.

  1. What should I do if I want to declare an array A as private for each thread ?
    Just add private(A) would work or should also create space by using copy|create ?

You would use private(A[0:size]). The copy/create data clauses create global memory that is shared across all threads.

  • Mat