aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2018-11-30 21:38:57 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2018-11-30 21:38:57 +0100
commitc223608f542416a5e47685013c680e256a583416 (patch)
tree5d194303498a9ceb6b8443b8bfba13f2eff270b9
parent9cb95c07fae669d450a0d29579e300ff52b45822 (diff)
downloadgcc-c223608f542416a5e47685013c680e256a583416.zip
gcc-c223608f542416a5e47685013c680e256a583416.tar.gz
gcc-c223608f542416a5e47685013c680e256a583416.tar.bz2
Add libgomp.oacc-fortran/lib-16-2.f90
This is a copy of libgomp.oacc-fortran/lib-16.f90, but does 'include "openacc_lib.h"' instead of 'use openacc'. libgomp/ * testsuite/libgomp.oacc-fortran/lib-16-2.f90: New file. From-SVN: r266683
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/lib-16-2.f9058
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/lib-16.f901
3 files changed, 63 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index d3c1bc3..a9dcbd8 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-30 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/lib-16-2.f90: New file.
+
2018-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/88182
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-16-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-16-2.f90
new file mode 100644
index 0000000..fa76f65
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-16-2.f90
@@ -0,0 +1,58 @@
+! See also "lib-16.f90".
+! { dg-do run }
+! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
+
+program main
+ implicit none
+ include "openacc_lib.h"
+
+ integer, parameter :: N = 256
+ integer, allocatable :: h(:)
+ integer :: i
+ integer :: async = 5
+
+ allocate (h(N))
+
+ do i = 1, N
+ h(i) = i
+ end do
+
+ call acc_copyin (h)
+
+ do i = 1, N
+ h(i) = i + i
+ end do
+
+ call acc_update_device_async (h, sizeof (h), async)
+
+ if (acc_is_present (h) .neqv. .TRUE.) call abort
+
+ h(:) = 0
+
+ call acc_copyout_async (h, sizeof (h), async)
+
+ call acc_wait (async)
+
+ do i = 1, N
+ if (h(i) /= i + i) call abort
+ end do
+
+ call acc_copyin (h, sizeof (h))
+
+ h(:) = 0
+
+ call acc_update_self_async (h, sizeof (h), async)
+
+ if (acc_is_present (h) .neqv. .TRUE.) call abort
+
+ do i = 1, N
+ if (h(i) /= i + i) call abort
+ end do
+
+ call acc_delete_async (h, async)
+
+ call acc_wait (async)
+
+ if (acc_is_present (h) .neqv. .FALSE.) call abort
+
+end program
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90 b/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
index 9701b52..011f9cf 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/lib-16.f90
@@ -1,3 +1,4 @@
+! See also "lib-16-2.f90".
! { dg-do run }
! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }