Debian Codegraph @

libgomp/testsuite/libgomp.oacc-fortran/dummy-array.f90

raw
1 ! Ensure that dummy arrays are transferred to the accelerator
2 ! via an implicit pcopy.
3
4 ! { dg-do run }
5
6 program main
7 integer, parameter :: n = 1000
8 integer :: a(n)
9 integer :: i
10
11 a(:) = -1
12
13 call dummy_array (a, n)
14
15 do i = 1, n
16 if (a(i) .ne. i) stop 1
17 end do
18 end program main
19
20 subroutine dummy_array (a, n)
21 integer a(n)
22
23 !$acc parallel loop num_gangs (100) gang
24 do i = 1, n
25 a(i) = i
26 end do
27 !$acc end parallel loop
28 end subroutine