On 11/05/2015 04:14 AM, Thomas Schwinge wrote:

> On Tue, 3 Nov 2015 14:16:59 -0800, Cesar Philippidis <ce...@codesourcery.com> 
> wrote:
>> This patch does the following to the c and c++ front ends:
> 
>>  * updates c_oacc_split_loop_clauses to filter out the loop clauses
>>    from combined parallel/kernels loops
> 
>>      gcc/c-family/
>>      * c-omp.c (c_oacc_split_loop_clauses): Make TILE, GANG, WORKER, VECTOR,
>>      AUTO, SEQ and independent as loop clauses.  Associate REDUCTION
>>      clauses with parallel and kernels.
> 
>> --- a/gcc/c-family/c-omp.c
>> +++ b/gcc/c-family/c-omp.c
>> @@ -709,12 +709,21 @@ c_oacc_split_loop_clauses (tree clauses, tree 
>> *not_loop_clauses)
>>  
>>        switch (OMP_CLAUSE_CODE (clauses))
>>          {
>> +      /* Loop clauses.  */
>>      case OMP_CLAUSE_COLLAPSE:
>> -    case OMP_CLAUSE_REDUCTION:
>> +    case OMP_CLAUSE_TILE:
>> +    case OMP_CLAUSE_GANG:
>> +    case OMP_CLAUSE_WORKER:
>> +    case OMP_CLAUSE_VECTOR:
>> +    case OMP_CLAUSE_AUTO:
>> +    case OMP_CLAUSE_SEQ:
>> +    case OMP_CLAUSE_INDEPENDENT:
>>        OMP_CLAUSE_CHAIN (clauses) = loop_clauses;
>>        loop_clauses = clauses;
>>        break;
>>  
>> +      /* Parallel/kernels clauses.  */
>> +
>>      default:
>>        OMP_CLAUSE_CHAIN (clauses) = *not_loop_clauses;
>>        *not_loop_clauses = clauses;
> 
> Contrary to your ChangeLog entry, this is not duplicating but is moving
> OMP_CLAUSE_REDUCTION handling.  Is that intentional?  (And, doesn't
> anything break in the testsuite?)

Sorry, I must have mis-phrased it. The spec is unclear here. There are
three possible ways to interpret 'acc parallel loop reduction':

  1. acc parallel reduction
     acc loop

  2. acc parallel
     acc loop reduction

  3. acc parallel reduction
     acc loop reduction


You told me to make all of the front ends consistent, and since I
started working on fortran first, I had c and c++ follow what it was doing.

I haven't observed any regressions with this in in place. Then again,
maybe we don't have sufficient test coverage. I'll do more testing.

Cesar

Reply via email to