aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
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/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95
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/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95')
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f9536
1 files changed, 36 insertions, 0 deletions
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