3 ! Test of attach/detach with "acc enter/exit data".
7 integer, parameter :: n
= 512
9 integer, allocatable
:: a(:)
10 integer, allocatable
:: b(:)
12 integer, allocatable
:: r(:)
21 !$acc enter data copyin(var)
23 !$acc enter data copyin(var%a, var%b, r)
31 !$acc end parallel loop
33 !$acc exit data copyout(var%a)
34 !$acc exit data copyout(var%b)
35 !$acc exit data copyout(r)
38 if (i
.ne
. var
%a(i
)) stop 1
39 if (i
* 2 .ne
. var
%b(i
)) stop 2
40 if (i
* 3 .ne
. r(i
)) stop 3
43 !$acc exit data delete(var)