1 ! ACC_PRESENT_OR_CREATE
, ACC_PRESENT_OR_COPYIN
, etc
.
2 ! Variant of
"../libgomp.oacc-c-c++-common/lib-32.c".
3 ! Variant using
"openacc_lib.h".
9 INCLUDE
"openacc_lib.h"
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))) STOP 1
26 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
30 !$ACC
END PARALLEL LOOP
33 IF (H
(I
) .NE
. I
+ MERGE
(1, 0, SHARED_MEM
)) STOP 2
37 CALL ACC_PRESENT_OR_CREATE
(H
)
39 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
41 IF (H
(I
) .NE
. I
+ MERGE
(2, 1, SHARED_MEM
)) STOP 3
44 !$ACC
END PARALLEL LOOP
47 IF (H
(I
) .NE
. I
+ MERGE
(3, 2, SHARED_MEM
)) STOP 4
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
)) STOP 5
58 !$ACC
END PARALLEL LOOP
61 IF (H
(I
) .NE
. I
+ MERGE
(5, 4, SHARED_MEM
)) STOP 6
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
)) STOP 7
72 !$ACC
END PARALLEL LOOP
75 IF (H
(I
) .NE
. I
+ MERGE
(7, 6, SHARED_MEM
)) STOP 8
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
)) STOP 9
86 !$ACC
END PARALLEL LOOP
89 IF (H
(I
) .NE
. I
+ MERGE
(9, 8, SHARED_MEM
)) STOP 10
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))) STOP 11
99 IF (H
(I
) .NE
. I
+ MERGE
(10, 9, SHARED_MEM
)) STOP 12
103 IF (.NOT
. ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 4))) STOP 13
105 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
107 IF (H
(I
) .NE
. I
+ MERGE
(10, 9, SHARED_MEM
)) STOP 14
110 !$ACC
END PARALLEL LOOP
113 IF (H
(I
) .NE
. I
+ MERGE
(11, 9, SHARED_MEM
)) STOP 15
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
)) STOP 16
124 !$ACC
END PARALLEL LOOP
127 IF (H
(I
) .NE
. I
+ MERGE
(13, 12, SHARED_MEM
)) STOP 17
133 !$ACC PARALLEL LOOP
DEFAULT (PRESENT
)
135 IF (H
(I
) .NE
. I
+ MERGE
(14, 13, SHARED_MEM
)) STOP 18
138 !$ACC
END PARALLEL LOOP
141 IF (H
(I
) .NE
. I
+ MERGE
(15, 14, SHARED_MEM
)) STOP 19
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
)) STOP 20
152 !$ACC
END PARALLEL LOOP
155 IF (H
(I
) .NE
. I
+ MERGE
(17, 16, SHARED_MEM
)) STOP 21
159 CALL ACC_UPDATE_SELF
(H
, INT
(SIZEOF
(H
), 4))
160 IF (.NOT
. ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 8))) STOP 22
163 IF (H
(I
) .NE
. I
+ MERGE
(18, 17, SHARED_MEM
)) STOP 23
167 IF (.NOT
. SHARED_MEM
) THEN
168 IF (ACC_IS_PRESENT
(H
, INT
(SIZEOF
(H
), 4))) STOP 24