1 ! { dg-do run { target openacc_nvidia_accel_selected } }
6 !$acc declare create (z)
9 subroutine subr6 (a
, d
)
11 integer, parameter :: N
= 8
14 !$acc declare deviceptr (a)
19 !$acc parallel copy (d)
27 subroutine subr5 (a
, b
, c
, d
)
29 integer, parameter :: N
= 8
32 !$acc declare present_or_copyin (a)
34 !$acc declare present_or_create (b)
36 !$acc declare present_or_copyout (c)
38 !$acc declare present_or_copy (d)
52 subroutine subr4 (a
, b
)
54 integer, parameter :: N
= 8
57 !$acc declare present (a)
59 !$acc declare copyout (b)
71 subroutine subr3 (a
, c
)
73 integer, parameter :: N
= 8
76 !$acc declare present (a)
78 !$acc declare copyin (c)
91 subroutine subr2 (a
, b
, c
)
93 integer, parameter :: N
= 8
96 !$acc declare present (a)
98 !$acc declare create (b)
100 !$acc declare copy (c)
107 c(i
) = b(i
) + c(i
) + 1
115 integer, parameter :: N
= 8
118 !$acc declare present (a)
130 subroutine test (a
, e
)
134 integer, parameter :: N
= 8
137 if (acc_is_present (a
) .neqv
. e
) call abort
141 subroutine subr0 (a
, b
, c
, d
)
143 integer, parameter :: N
= 8
145 !$acc declare copy (a)
151 call test (a
, .true
.)
152 call test (b
, .false
.)
153 call test (c
, .false
.)
157 call test (a
, .true
.)
158 call test (b
, .false
.)
159 call test (c
, .false
.)
163 call test (a
, .true
.)
164 call test (b
, .false
.)
165 call test (c
, .false
.)
168 if (c(i
) .ne
. 8) call abort
173 call test (a
, .true
.)
174 call test (b
, .false
.)
175 call test (c
, .false
.)
178 if (a(i
) .ne
. 2) call abort
179 if (c(i
) .ne
. 8) call abort
184 call test (a
, .true
.)
185 call test (b
, .false
.)
186 call test (c
, .false
.)
189 if (b(i
) .ne
. 8) call abort
192 call subr5 (a
, b
, c
, d
)
194 call test (a
, .true
.)
195 call test (b
, .false
.)
196 call test (c
, .false
.)
197 call test (d
, .false
.)
200 if (c(i
) .ne
. 8) call abort
201 if (d(i
) .ne
. 13) call abort
206 call test (a
, .true
.)
207 call test (d
, .false
.)
210 if (d(i
) .ne
. 16) call abort
219 integer, parameter :: N
= 8
231 if (acc_is_present (z
) .neqv
. .true
.) call abort
233 call subr0 (a
, b
, c
, d
)
235 call test (a
, .false
.)
236 call test (b
, .false
.)
237 call test (c
, .false
.)
238 call test (d
, .false
.)
241 if (a(i
) .ne
. 8) call abort
242 if (b(i
) .ne
. 8) call abort
243 if (c(i
) .ne
. 8) call abort
244 if (d(i
) .ne
. 16) call abort