aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-03-09 09:14:21 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-03-09 09:14:21 +0000
commit5a6452e6606550a4a84e929d90971a9d78d5f6de (patch)
treef427dcf84e47c5dd35775260e3dedfeeb4748641 /libgomp
parentbf751f40a851b4c792ef34d98c11c30d66cdc40d (diff)
downloadgcc-5a6452e6606550a4a84e929d90971a9d78d5f6de.zip
gcc-5a6452e6606550a4a84e929d90971a9d78d5f6de.tar.gz
gcc-5a6452e6606550a4a84e929d90971a9d78d5f6de.tar.bz2
Add oacc kernels testcases in libgomp.oacc-fortran
2016-03-09 Tom de Vries <tom@codesourcery.com> * testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: New test. * testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95: Same. * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95: Same. * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95: Same. * testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95: Same. * testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Same. * testsuite/libgomp.oacc-fortran/kernels-loop.f95: Same. From-SVN: r234078
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog11
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f9532
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f9538
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f9538
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f9536
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f9536
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f9536
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f9528
8 files changed, 255 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index ab8cfd4..70db898 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,14 @@
+2016-03-09 Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: New test.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95: Same.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95:
+ Same.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95: Same.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95: Same.
+ * testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Same.
+ * testsuite/libgomp.oacc-fortran/kernels-loop.f95: Same.
+
2016-03-07 Martin Jambor <mjambor@suse.cz>
* testsuite/lib/libgomp.exp
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
new file mode 100644
index 0000000..1fb40ee
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
@@ -0,0 +1,32 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc kernels copyout (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+
+ !$acc kernels copyout (b(0:n-1))
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+ !$acc end kernels
+
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95
new file mode 100644
index 0000000..7b52253
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95
@@ -0,0 +1,38 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc data copyout (a(0:n-1))
+ !$acc kernels present (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+ !$acc end data
+
+ !$acc data copyout (b(0:n-1))
+ !$acc kernels present (b(0:n-1))
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+ !$acc end kernels
+ !$acc end data
+
+ !$acc data copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
+ !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+ !$acc end data
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
new file mode 100644
index 0000000..af98efa
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95
@@ -0,0 +1,38 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc enter data create (a(0:n-1))
+ !$acc kernels present (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+ !$acc exit data copyout (a(0:n-1))
+
+ !$acc enter data create (b(0:n-1))
+ !$acc kernels present (b(0:n-1))
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+ !$acc end kernels
+ !$acc exit data copyout (b(0:n-1))
+
+ !$acc enter data copyin (a(0:n-1), b(0:n-1)) create (c(0:n-1))
+ !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+ !$acc exit data copyout (c(0:n-1))
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
new file mode 100644
index 0000000..bb6f8dc
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95
@@ -0,0 +1,36 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc enter data create (a(0:n-1), b(0:n-1), c(0:n-1))
+
+ !$acc kernels present (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+
+ !$acc kernels present (b(0:n-1))
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+ !$acc end kernels
+
+ !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+
+ !$acc exit data copyout (a(0:n-1), b(0:n-1), c(0:n-1))
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
new file mode 100644
index 0000000..cab1f2c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
@@ -0,0 +1,36 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc enter data create (a(0:n-1), b(0:n-1), c(0:n-1))
+
+ !$acc kernels present (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+
+ !$acc update device (b(0:n-1))
+
+ !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+
+ !$acc exit data copyout (a(0:n-1), c(0:n-1))
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95
new file mode 100644
index 0000000..f26671d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data.f95
@@ -0,0 +1,36 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ !$acc data copyout (a(0:n-1), b(0:n-1), c(0:n-1))
+
+ !$acc kernels present (a(0:n-1))
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+ !$acc end kernels
+
+ !$acc kernels present (b(0:n-1))
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+ !$acc end kernels
+
+ !$acc kernels present (a(0:n-1), b(0:n-1), c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+
+ !$acc end data
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
new file mode 100644
index 0000000..b02dd57
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
@@ -0,0 +1,28 @@
+! { dg-do run }
+! { dg-options "-ftree-parallelize-loops=32" }
+
+program main
+ implicit none
+ integer, parameter :: n = 1024
+ integer, dimension (0:n-1) :: a, b, c
+ integer :: i, ii
+
+ do i = 0, n - 1
+ a(i) = i * 2
+ end do
+
+ do i = 0, n -1
+ b(i) = i * 4
+ end do
+
+ !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
+ do ii = 0, n - 1
+ c(ii) = a(ii) + b(ii)
+ end do
+ !$acc end kernels
+
+ do i = 0, n - 1
+ if (c(i) .ne. a(i) + b(i)) call abort
+ end do
+
+end program main