ffbdd78a4a
* testsuite/libgomp.oacc-fortran/abort-1.f90: Add 'dg-do run'. * testsuite/libgomp.oacc-fortran/abort-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/common-block-1.f90: Use 'stop' not abort(). * testsuite/libgomp.oacc-fortran/common-block-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/common-block-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/data-5.f90: Ditto. * testsuite/libgomp.oacc-fortran/dummy-array.f90: Ditto. * testsuite/libgomp.oacc-fortran/gemm-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/gemm.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/host_data-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-collapse-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-collapse-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-independent.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-loop-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-map-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-6.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-vector-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-vector-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-3.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-4.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-5.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-6.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-private-vars-worker-7.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-reduction-1.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-12.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-13.f90: Ditto. * testsuite/libgomp.oacc-fortran/lib-14.f90: Ditto. * testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90: Likewise and also add 'dg-do run'. * testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction.f90: Ditto. From-SVN: r277503
117 lines
1.6 KiB
Fortran
117 lines
1.6 KiB
Fortran
! Test the copy, copyin, copyout, pcopy, pcopyin, pcopyout, and pcreate
|
|
! clauses on kernels constructs.
|
|
|
|
! { dg-do run }
|
|
|
|
program map
|
|
integer, parameter :: n = 20, c = 10
|
|
integer :: i, a(n), b(n), d(n)
|
|
|
|
a(:) = 0
|
|
b(:) = 0
|
|
|
|
! COPY
|
|
|
|
!$acc kernels copy (a)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
do i = 1, n
|
|
b(i) = i
|
|
end do
|
|
|
|
call check (a, b, n)
|
|
|
|
! COPYOUT
|
|
|
|
a(:) = 0
|
|
|
|
!$acc kernels copyout (a)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
do i = 1, n
|
|
if (a(i) .ne. b(i)) stop 1
|
|
end do
|
|
call check (a, b, n)
|
|
|
|
! COPYIN
|
|
|
|
a(:) = 0
|
|
|
|
!$acc kernels copyout (a) copyin (b)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
call check (a, b, n)
|
|
|
|
! PRESENT_OR_COPY
|
|
|
|
!$acc kernels pcopy (a)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
call check (a, b, n)
|
|
|
|
! PRESENT_OR_COPYOUT
|
|
|
|
a(:) = 0
|
|
|
|
!$acc kernels pcopyout (a)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
call check (a, b, n)
|
|
|
|
! PRESENT_OR_COPYIN
|
|
|
|
a(:) = 0
|
|
|
|
!$acc kernels pcopyout (a) pcopyin (b)
|
|
!$acc loop
|
|
do i = 1, n
|
|
a(i) = i
|
|
end do
|
|
!$acc end kernels
|
|
|
|
call check (a, b, n)
|
|
|
|
! PRESENT_OR_CREATE
|
|
|
|
a(:) = 0
|
|
|
|
!$acc kernels pcopyout (a) pcreate (d)
|
|
!$acc loop
|
|
do i = 1, n
|
|
d(i) = i
|
|
a(i) = d(i)
|
|
end do
|
|
!$acc end kernels
|
|
|
|
call check (a, b, n)
|
|
end program map
|
|
|
|
subroutine check (a, b, n)
|
|
integer :: n, a(n), b(n)
|
|
integer :: i
|
|
|
|
do i = 1, n
|
|
if (a(i) .ne. b(i)) stop 2
|
|
end do
|
|
end subroutine check
|