diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2016-01-15 06:49:55 -0800 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2016-01-15 06:49:55 -0800 |
commit | 33a126a6f2669a29a6657bffa96214ea33de211b (patch) | |
tree | 60de8fc3a07ebcd9cfacd0fd6e4b83d1bd7079c9 /libgomp | |
parent | a00fe3b787de1916bed415c57024d49bbe81cb1c (diff) | |
download | gcc-33a126a6f2669a29a6657bffa96214ea33de211b.zip gcc-33a126a6f2669a29a6657bffa96214ea33de211b.tar.gz gcc-33a126a6f2669a29a6657bffa96214ea33de211b.tar.bz2 |
gimplify.c (oacc_default_clause): Decode reference and pointer types for both kernels and parallel regions.
gcc/
* gimplify.c (oacc_default_clause): Decode reference and pointer
types for both kernels and parallel regions.
libgomp/
* testsuite/libgomp.oacc-fortran/kernels-data.f90: New test.
From-SVN: r232431
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90 | 50 |
2 files changed, 54 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 5918752..be30656 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2016-01-15 Cesar Philippidis <cesar@codesourcery.com> + + * testsuite/libgomp.oacc-fortran/kernels-data.f90: New test. + 2016-01-12 James Norris <jnorris@codesourcery.com> * libgomp.texi: Updates for OpenACC. diff --git a/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90 b/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90 new file mode 100644 index 0000000..4afb562 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-fortran/non-scalar-data.f90 @@ -0,0 +1,50 @@ +! Ensure that a non-scalar dummy arguments which are implicitly used inside +! offloaded regions are properly mapped using present_or_copy. + +! { dg-do run } + +program main + implicit none + + integer, parameter :: n = 100 + integer :: array(n), i + + !$acc data copy(array) + call kernels(array, n) + + !$acc update host(array) + + do i = 1, n + if (array(i) .ne. i) call abort + end do + + call parallel(array, n) + !$acc end data + + do i = 1, n + if (array(i) .ne. i+i) call abort + end do +end program main + +subroutine kernels (array, n) + integer, dimension (n) :: array + integer :: n, i + + !$acc kernels + do i = 1, n + array(i) = i + end do + !$acc end kernels +end subroutine kernels + + +subroutine parallel (array, n) + integer, dimension (n) :: array + integer :: n, i + + !$acc parallel + do i = 1, n + array(i) = i+i + end do + !$acc end parallel +end subroutine parallel |