openacc: Allow strided arrays in update directives
authorJulian Brown <julian@codesourcery.com>
Tue, 2 Feb 2021 11:44:34 +0000 (03:44 -0800)
committerJulian Brown <julian@codesourcery.com>
Thu, 4 Feb 2021 23:06:22 +0000 (15:06 -0800)
commit9a4d32f85ccebc0ee4b24e6d9d7a4f11c04d7146
tree9b47e00d20731fb47c9f61a1fdf40ca76843c091
parentf743fe231663e32d52db987650d0ec3381a777af
openacc: Allow strided arrays in update directives

OpenACC 3.0 ("2.14.4. Update Directive") states:

  Noncontiguous subarrays may appear. It is implementation-specific
  whether noncontiguous regions are updated by using one transfer for
  each contiguous subregion, or whether the non-contiguous data is
  packed, transferred once, and unpacked, or whether one or more larger
  subarrays (no larger than the smallest contiguous region that contains
  the specified subarray) are updated.

This patch relaxes some conditions in the Fortran front-end so that
strided accesses are permitted for update directives.

gcc/fortran/
* openmp.c (resolve_omp_clauses): Omit OpenACC update in
contiguity check and stride-specified error.

gcc/testsuite/
* gfortran.dg/goacc/array-with-dt-2.f90: New test.

libgomp/
* testsuite/libgomp.oacc-fortran/array-stride-dt-1.f90: New test.
gcc/fortran/openmp.c
gcc/testsuite/gfortran.dg/goacc/array-with-dt-2.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/array-stride-dt-1.f90 [new file with mode: 0644]