2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-03 08:50:31 +08:00

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
This commit is contained in:
Tom de Vries 2016-03-09 09:14:21 +00:00 committed by Tom de Vries
parent bf751f40a8
commit 5a6452e660
8 changed files with 255 additions and 0 deletions

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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