[PATCH 2/4] [GOMP4] [Fortran] OpenACC 1.0+ support in fortran front-end

Ilmir Usmanov i.usmanov@samsung.com
Tue Mar 11 11:59:00 GMT 2014


Hi Tobias!

Thanks a lot for your review and comments!

I tried to fix the patch according them.

On 08.03.2014 23:48, Tobias Burnus wrote:
>
> (Side question: Is !$acc permitted in DO ... WHILE? If so, you need to 
> also add EXEC_DO_WHILE.)
>
No, current implementation rejects DO WHILE loops, just like OpenMP:
static void
resolve_oacc_nested_loops (gfc_code *code, gfc_code* do_code, int collapse,
               const char *clause)
...
       if (do_code->op == EXEC_DO_WHILE)
     {
       gfc_error ("!$ACC LOOP cannot be a DO WHILE or DO without loop 
control "
              "at %L", &do_code->loc);
       break;
     }

>> +static void
>> +check_array_not_assumed (gfc_symbol *sym, locus loc, const char *name)
>> +{
>> +  if (sym->as && sym->as->type == AS_ASSUMED_SIZE)
>> +    gfc_error ("Assumed size array '%s' in %s clause at %L",
>> +           sym->name, name, &loc);
>> +  if (sym->as && sym->as->type == AS_ASSUMED_SHAPE)
>> +    gfc_error ("Assumed shape array '%s' in %s clause at %L",
>> +           sym->name, name, &loc);
>> +  if (sym->as && sym->as->type == AS_ASSUMED_RANK)
>> +    gfc_error ("Assumed rank array '%s' in %s clause at %L",
>> +           sym->name, name, &loc);
>> +}
>
> Actually, I wonder whether one needs to reject assumed-shape: I don't 
> know what OpenACC says, but my impression is that the problem is that 
> those can be noncontiguous. However, if they are marked as contiguous 
> ["attr.contiguous"] Â…
>
You are right. I found several examples of assumed shape arrays used in 
data clauses, like:
subroutine vecaddgpu( r, a, b, n )
   real, dimension(:) :: r, a, b
   integer :: n
   integer :: i
   !$acc kernels loop present(r,a,b)
   do i = 1, n
     r(i) = a(i) + b(i)
   enddo
end subroutine


Is it OK now?

-- 
Ilmir.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OpenACC-Fortran-FE-part-2.patch
Type: text/x-diff
Size: 42244 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140311/c7e5cfcd/attachment.bin>


More information about the Fortran mailing list