ccc8282bab
gcc/ * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add checking. libgomp/ * testsuite/libgomp.oacc-fortran/reduction-1.f90: Fix dimensions and reduction copy. * testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise. * testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise. * testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: New. From-SVN: r229780
31 lines
504 B
Fortran
31 lines
504 B
Fortran
! { dg-do run }
|
|
|
|
program reduction
|
|
implicit none
|
|
|
|
integer, parameter :: n = 100
|
|
integer :: i, s1, s2, vs1, vs2
|
|
|
|
s1 = 0
|
|
s2 = 0
|
|
vs1 = 0
|
|
vs2 = 0
|
|
|
|
!$acc parallel vector_length (32) copy(s1, s2)
|
|
!$acc loop reduction(+:s1, s2)
|
|
do i = 1, n
|
|
s1 = s1 + 1
|
|
s2 = s2 + 2
|
|
end do
|
|
!$acc end parallel
|
|
|
|
! Verify the results
|
|
do i = 1, n
|
|
vs1 = vs1 + 1
|
|
vs2 = vs2 + 2
|
|
end do
|
|
|
|
if (s1.ne.vs1) call abort ()
|
|
if (s2.ne.vs2) call abort ()
|
|
end program reduction
|