8 integer, target
:: a_3d_i(10, 10, 10)
9 complex a_3d_c(10, 10, 10)
10 real a_3d_r(10, 10, 10)
15 integer, parameter :: i_size
= sizeof (i
)
16 integer, parameter :: c_size
= sizeof (c
)
17 integer, parameter :: r_size
= sizeof (r
)
19 call acc_init (acc_device_default
)
21 call set3d (.FALSE
., a_3d_i
, a_3d_c
, a_3d_r
)
23 call acc_copyin (a_3d_i
)
24 call acc_copyin (a_3d_c
)
25 call acc_copyin (a_3d_r
)
27 if (acc_is_present (a_3d_i
) .neqv
. .TRUE
.) STOP 1
28 if (acc_is_present (a_3d_c
) .neqv
. .TRUE
.) STOP 2
29 if (acc_is_present (a_3d_r
) .neqv
. .TRUE
.) STOP 3
34 if (acc_is_present (a_3d_i(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 4
35 if (acc_is_present (a_3d_c(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 5
36 if (acc_is_present (a_3d_r(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 6
43 subroutine set3d (clear
, a_i
, a_c
, a_r
)
45 integer, dimension (:,:,:), intent (inout
) :: a_i
46 complex, dimension (:,:,:), intent (inout
) :: a_c
47 real, dimension (:,:,:), intent (inout
) :: a_r
50 integer lb1
, ub1
, lb2
, ub2
, lb3
, ub3
66 a_c(i
, j
, k
) = cmplx (0.0, 0.0)
70 a_c(i
, j
, k
) = cmplx (i
, j
)