On 04/08/16 00:40, Jakub Jelinek wrote:
+/* OpenACC parallel reductions need a present_or_copy clause to ensure
+ that the original variable used in the reduction gets updated on
+ the host. Scan the list of clauses for reduction so that any existing
+ data clause can be adjusted if necessary. */
+ if (region_type == ORT_ACC_PARALLEL)
+ {
+ for (c = *list_p; c; c = OMP_CLAUSE_CHAIN (c))
+ {
+ tree decl = NULL_TREE;
+
+ if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_REDUCTION)
+ continue;
+
+ decl = OMP_CLAUSE_DECL (c);
+ omp_add_variable (ctx, decl, GOVD_REDUCTION);
+ }
+ }
+
And this looks also wrong, why?
And besides, won't it break
#pragma acc parallel firstprivate (x) reduction(+:x)
{...}
which the openacc guys at GTC indicated they didn't want to disallow (without
further thinking).
It seems to me the interaction of reduction and data copying at a parallel is
still not sufficiently well defined.
nathan