5 include "openacc_lib.h"
7 integer, target
:: a_3d_i(10, 10, 10)
8 complex a_3d_c(10, 10, 10)
9 real a_3d_r(10, 10, 10)
14 integer, parameter :: i_size
= sizeof (i
)
15 integer, parameter :: c_size
= sizeof (c
)
16 integer, parameter :: r_size
= sizeof (r
)
18 call acc_init (acc_device_default
)
20 call set3d (.FALSE
., a_3d_i
, a_3d_c
, a_3d_r
)
22 call acc_copyin (a_3d_i
)
23 call acc_copyin (a_3d_c
)
24 call acc_copyin (a_3d_r
)
26 if (acc_is_present (a_3d_i
) .neqv
. .TRUE
.) STOP 1
27 if (acc_is_present (a_3d_c
) .neqv
. .TRUE
.) STOP 2
28 if (acc_is_present (a_3d_r
) .neqv
. .TRUE
.) STOP 3
33 if (acc_is_present (a_3d_i(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 4
34 if (acc_is_present (a_3d_c(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 5
35 if (acc_is_present (a_3d_r(i
, j
, k
), i_size
) .neqv
. .TRUE
.) STOP 6
42 subroutine set3d (clear
, a_i
, a_c
, a_r
)
44 integer, dimension (:,:,:), intent (inout
) :: a_i
45 complex, dimension (:,:,:), intent (inout
) :: a_c
46 real, dimension (:,:,:), intent (inout
) :: a_r
49 integer lb1
, ub1
, lb2
, ub2
, lb3
, ub3
65 a_c(i
, j
, k
) = cmplx (0.0, 0.0)
69 a_c(i
, j
, k
) = cmplx (i
, j
)