1 ! ACC_PRESENT_OR_CREATE
, ACC_PRESENT_OR_COPYIN
, etc
.
2 ! Variant of
"../libgomp.oacc-c-c++-common/lib-32.c".
3 ! Variant using the
"openacc" module
.
11 INTEGER, PARAMETER :: N
= 10000
12 INTEGER, ALLOCATABLE
:: H
(:)
21 SHARED_MEM
= ACC_IS_PRESENT
(H
)
23 CALL ACC_PRESENT_OR_CREATE
(H
, INT
(SIZEOF
(H
), 4))
24 IF (.NOT
. ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 8))) CALL ABORT
26 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
30 !$ACC
END PARALLEL LOOP
33 IF (H
(I
) .NE
. I
+ MERGE
(1, 0, SHARED_MEM
)) CALL ABORT
37 CALL ACC_PRESENT_OR_CREATE
(H
)
39 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
41 IF (H
(I
) .NE
. I
+ MERGE
(2, 1, SHARED_MEM
)) CALL ABORT
44 !$ACC
END PARALLEL LOOP
47 IF (H
(I
) .NE
. I
+ MERGE
(3, 2, SHARED_MEM
)) CALL ABORT
51 CALL ACC_PCREATE
(H
, INT
(SIZEOF
(H
), 4))
53 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
55 IF (H
(I
) .NE
. I
+ MERGE
(4, 3, SHARED_MEM
)) CALL ABORT
58 !$ACC
END PARALLEL LOOP
61 IF (H
(I
) .NE
. I
+ MERGE
(5, 4, SHARED_MEM
)) CALL ABORT
65 CALL ACC_PRESENT_OR_COPYIN
(H
, INT
(SIZEOF
(H
), 8))
67 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
69 IF (H
(I
) .NE
. I
+ MERGE
(6, 5, SHARED_MEM
)) CALL ABORT
72 !$ACC
END PARALLEL LOOP
75 IF (H
(I
) .NE
. I
+ MERGE
(7, 6, SHARED_MEM
)) CALL ABORT
79 CALL ACC_PCOPYIN
(H
, INT
(SIZEOF
(H
), 4))
81 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
83 IF (H
(I
) .NE
. I
+ MERGE
(8, 7, SHARED_MEM
)) CALL ABORT
86 !$ACC
END PARALLEL LOOP
89 IF (H
(I
) .NE
. I
+ MERGE
(9, 8, SHARED_MEM
)) CALL ABORT
93 CALL ACC_COPYOUT
(H
, INT
(SIZEOF
(H
), 4))
94 IF (.NOT
. SHARED_MEM
) THEN
95 IF (ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 8))) CALL ABORT
99 IF (H
(I
) .NE
. I
+ MERGE
(10, 9, SHARED_MEM
)) CALL ABORT
103 IF (.NOT
. ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 4))) CALL ABORT
105 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
107 IF (H
(I
) .NE
. I
+ MERGE
(10, 9, SHARED_MEM
)) CALL ABORT
110 !$ACC
END PARALLEL LOOP
113 IF (H
(I
) .NE
. I
+ MERGE
(11, 9, SHARED_MEM
)) CALL ABORT
117 CALL ACC_PCOPYIN
(H
, INT
(SIZEOF
(H
), 8))
119 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
121 IF (H
(I
) .NE
. I
+ MERGE
(12, 11, SHARED_MEM
)) CALL ABORT
124 !$ACC
END PARALLEL LOOP
127 IF (H
(I
) .NE
. I
+ MERGE
(13, 12, SHARED_MEM
)) CALL ABORT
133 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
135 IF (H
(I
) .NE
. I
+ MERGE
(14, 13, SHARED_MEM
)) CALL ABORT
138 !$ACC
END PARALLEL LOOP
141 IF (H
(I
) .NE
. I
+ MERGE
(15, 14, SHARED_MEM
)) CALL ABORT
145 CALL ACC_PCREATE
(H
, INT
(SIZEOF
(H
), 8))
147 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
149 IF (H
(I
) .NE
. I
+ MERGE
(16, 15, SHARED_MEM
)) CALL ABORT
152 !$ACC
END PARALLEL LOOP
155 IF (H
(I
) .NE
. I
+ MERGE
(17, 16, SHARED_MEM
)) CALL ABORT
159 CALL ACC_UPDATE_SELF
(H
, INT
(SIZEOF
(H
), 4))
160 IF (.NOT
. ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 8))) CALL ABORT
163 IF (H
(I
) .NE
. I
+ MERGE
(18, 17, SHARED_MEM
)) CALL ABORT
167 IF (.NOT
. SHARED_MEM
) THEN
168 IF (ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 4))) CALL ABORT