Retro68/gcc/libgomp/testsuite/libgomp.oacc-fortran/pr68813.f90
2017-04-10 13:32:00 +02:00

20 lines
370 B
Fortran

program foo
implicit none
integer, parameter :: n = 100
integer, dimension(n,n) :: a
integer :: i, j, sum = 0
a = 1
!$acc parallel copyin(a(1:n,1:n)) firstprivate (sum)
!$acc loop gang reduction(+:sum)
do i=1, n
!$acc loop vector reduction(+:sum)
do j=1, n
sum = sum + a(i, j)
enddo
enddo
!$acc end parallel
end program foo