| 1 |
! { dg-do run } |
| 2 |
|
| 3 |
program test |
| 4 |
implicit none |
| 5 |
integer, allocatable :: a1(:) |
| 6 |
integer, allocatable :: b1(:) |
| 7 |
integer, allocatable :: c1(:) |
| 8 |
integer, allocatable :: b2(:,:) |
| 9 |
integer, allocatable :: c3(:,:,:) |
| 10 |
|
| 11 |
allocate (a1(5)) |
| 12 |
if (.not.allocated (a1)) STOP 49 |
| 13 |
|
| 14 |
a1 = 10 |
| 15 |
|
| 16 |
!$acc parallel copy(a1(1:5)) |
| 17 |
a1(1) = 1 |
| 18 |
a1(2) = 2 |
| 19 |
a1(3) = 3 |
| 20 |
a1(4) = 4 |
| 21 |
a1(5) = 5 |
| 22 |
!$acc end parallel |
| 23 |
|
| 24 |
if (a1(1) .ne. 1) STOP 1 |
| 25 |
if (a1(2) .ne. 2) STOP 2 |
| 26 |
if (a1(3) .ne. 3) STOP 3 |
| 27 |
if (a1(4) .ne. 4) STOP 4 |
| 28 |
if (a1(5) .ne. 5) STOP 5 |
| 29 |
|
| 30 |
deallocate(a1) |
| 31 |
|
| 32 |
allocate (a1(0:4)) |
| 33 |
if (.not.allocated (a1)) STOP 50 |
| 34 |
|
| 35 |
a1 = 10 |
| 36 |
|
| 37 |
!$acc parallel copy(a1(0:4)) |
| 38 |
a1(0) = 1 |
| 39 |
a1(1) = 2 |
| 40 |
a1(2) = 3 |
| 41 |
a1(3) = 4 |
| 42 |
a1(4) = 5 |
| 43 |
!$acc end parallel |
| 44 |
|
| 45 |
if (a1(0) .ne. 1) STOP 6 |
| 46 |
if (a1(1) .ne. 2) STOP 7 |
| 47 |
if (a1(2) .ne. 3) STOP 8 |
| 48 |
if (a1(3) .ne. 4) STOP 9 |
| 49 |
if (a1(4) .ne. 5) STOP 10 |
| 50 |
|
| 51 |
deallocate(a1) |
| 52 |
|
| 53 |
allocate (b2(5,5)) |
| 54 |
if (.not.allocated (b2)) STOP 51 |
| 55 |
|
| 56 |
b2 = 11 |
| 57 |
|
| 58 |
!$acc parallel copy(b2(1:5,1:5)) |
| 59 |
b2(1,1) = 1 |
| 60 |
b2(2,2) = 2 |
| 61 |
b2(3,3) = 3 |
| 62 |
b2(4,4) = 4 |
| 63 |
b2(5,5) = 5 |
| 64 |
!$acc end parallel |
| 65 |
|
| 66 |
if (b2(1,1) .ne. 1) STOP 11 |
| 67 |
if (b2(2,2) .ne. 2) STOP 12 |
| 68 |
if (b2(3,3) .ne. 3) STOP 13 |
| 69 |
if (b2(4,4) .ne. 4) STOP 14 |
| 70 |
if (b2(5,5) .ne. 5) STOP 15 |
| 71 |
|
| 72 |
deallocate(b2) |
| 73 |
|
| 74 |
allocate (b2(0:4,0:4)) |
| 75 |
if (.not.allocated (b2)) STOP 52 |
| 76 |
|
| 77 |
b2 = 11 |
| 78 |
|
| 79 |
!$acc parallel copy(b2(0:4,0:4)) |
| 80 |
b2(0,0) = 1 |
| 81 |
b2(1,1) = 2 |
| 82 |
b2(2,2) = 3 |
| 83 |
b2(3,3) = 4 |
| 84 |
b2(4,4) = 5 |
| 85 |
!$acc end parallel |
| 86 |
|
| 87 |
if (b2(0,0) .ne. 1) STOP 16 |
| 88 |
if (b2(1,1) .ne. 2) STOP 17 |
| 89 |
if (b2(2,2) .ne. 3) STOP 18 |
| 90 |
if (b2(3,3) .ne. 4) STOP 19 |
| 91 |
if (b2(4,4) .ne. 5) STOP 20 |
| 92 |
|
| 93 |
deallocate(b2) |
| 94 |
|
| 95 |
allocate (c3(5,5,5)) |
| 96 |
if (.not.allocated (c3)) STOP 53 |
| 97 |
|
| 98 |
c3 = 12 |
| 99 |
|
| 100 |
!$acc parallel copy(c3(1:5,1:5,1:5)) |
| 101 |
c3(1,1,1) = 1 |
| 102 |
c3(2,2,2) = 2 |
| 103 |
c3(3,3,3) = 3 |
| 104 |
c3(4,4,4) = 4 |
| 105 |
c3(5,5,5) = 5 |
| 106 |
!$acc end parallel |
| 107 |
|
| 108 |
if (c3(1,1,1) .ne. 1) STOP 21 |
| 109 |
if (c3(2,2,2) .ne. 2) STOP 22 |
| 110 |
if (c3(3,3,3) .ne. 3) STOP 23 |
| 111 |
if (c3(4,4,4) .ne. 4) STOP 24 |
| 112 |
if (c3(5,5,5) .ne. 5) STOP 25 |
| 113 |
|
| 114 |
deallocate(c3) |
| 115 |
|
| 116 |
allocate (c3(0:4,0:4,0:4)) |
| 117 |
if (.not.allocated (c3)) STOP 54 |
| 118 |
|
| 119 |
c3 = 12 |
| 120 |
|
| 121 |
!$acc parallel copy(c3(0:4,0:4,0:4)) |
| 122 |
c3(0,0,0) = 1 |
| 123 |
c3(1,1,1) = 2 |
| 124 |
c3(2,2,2) = 3 |
| 125 |
c3(3,3,3) = 4 |
| 126 |
c3(4,4,4) = 5 |
| 127 |
!$acc end parallel |
| 128 |
|
| 129 |
if (c3(0,0,0) .ne. 1) STOP 26 |
| 130 |
if (c3(1,1,1) .ne. 2) STOP 27 |
| 131 |
if (c3(2,2,2) .ne. 3) STOP 28 |
| 132 |
if (c3(3,3,3) .ne. 4) STOP 29 |
| 133 |
if (c3(4,4,4) .ne. 5) STOP 30 |
| 134 |
|
| 135 |
deallocate(c3) |
| 136 |
|
| 137 |
allocate (a1(5)) |
| 138 |
if (.not.allocated (a1)) STOP 55 |
| 139 |
|
| 140 |
allocate (b1(5)) |
| 141 |
if (.not.allocated (b1)) STOP 56 |
| 142 |
|
| 143 |
allocate (c1(5)) |
| 144 |
if (.not.allocated (c1)) STOP 57 |
| 145 |
|
| 146 |
a1 = 10 |
| 147 |
b1 = 3 |
| 148 |
c1 = 7 |
| 149 |
|
| 150 |
!$acc parallel copyin(a1(1:5)) create(c1(1:5)) copyout(b1(1:5)) |
| 151 |
c1(1) = a1(1) |
| 152 |
c1(2) = a1(2) |
| 153 |
c1(3) = a1(3) |
| 154 |
c1(4) = a1(4) |
| 155 |
c1(5) = a1(5) |
| 156 |
|
| 157 |
b1(1) = c1(1) |
| 158 |
b1(2) = c1(2) |
| 159 |
b1(3) = c1(3) |
| 160 |
b1(4) = c1(4) |
| 161 |
b1(5) = c1(5) |
| 162 |
!$acc end parallel |
| 163 |
|
| 164 |
if (b1(1) .ne. 10) STOP 31 |
| 165 |
if (b1(2) .ne. 10) STOP 32 |
| 166 |
if (b1(3) .ne. 10) STOP 33 |
| 167 |
if (b1(4) .ne. 10) STOP 34 |
| 168 |
if (b1(5) .ne. 10) STOP 35 |
| 169 |
|
| 170 |
deallocate(a1) |
| 171 |
deallocate(b1) |
| 172 |
deallocate(c1) |
| 173 |
|
| 174 |
allocate (a1(0:4)) |
| 175 |
if (.not.allocated (a1)) STOP 58 |
| 176 |
|
| 177 |
allocate (b1(0:4)) |
| 178 |
if (.not.allocated (b1)) STOP 59 |
| 179 |
|
| 180 |
allocate (c1(0:4)) |
| 181 |
if (.not.allocated (c1)) STOP 60 |
| 182 |
|
| 183 |
a1 = 10 |
| 184 |
b1 = 3 |
| 185 |
c1 = 7 |
| 186 |
|
| 187 |
!$acc parallel copyin(a1(0:4)) create(c1(0:4)) copyout(b1(0:4)) |
| 188 |
c1(0) = a1(0) |
| 189 |
c1(1) = a1(1) |
| 190 |
c1(2) = a1(2) |
| 191 |
c1(3) = a1(3) |
| 192 |
c1(4) = a1(4) |
| 193 |
|
| 194 |
b1(0) = c1(0) |
| 195 |
b1(1) = c1(1) |
| 196 |
b1(2) = c1(2) |
| 197 |
b1(3) = c1(3) |
| 198 |
b1(4) = c1(4) |
| 199 |
!$acc end parallel |
| 200 |
|
| 201 |
if (b1(0) .ne. 10) STOP 36 |
| 202 |
if (b1(1) .ne. 10) STOP 37 |
| 203 |
if (b1(2) .ne. 10) STOP 38 |
| 204 |
if (b1(3) .ne. 10) STOP 39 |
| 205 |
if (b1(4) .ne. 10) STOP 40 |
| 206 |
|
| 207 |
deallocate(a1) |
| 208 |
deallocate(b1) |
| 209 |
deallocate(c1) |
| 210 |
|
| 211 |
allocate (a1(5)) |
| 212 |
if (.not.allocated (a1)) STOP 61 |
| 213 |
|
| 214 |
a1 = 10 |
| 215 |
|
| 216 |
!$acc parallel copy(a1(2:3)) |
| 217 |
a1(2) = 2 |
| 218 |
a1(3) = 3 |
| 219 |
!$acc end parallel |
| 220 |
|
| 221 |
if (a1(1) .ne. 10) STOP 41 |
| 222 |
if (a1(2) .ne. 2) STOP 42 |
| 223 |
if (a1(3) .ne. 3) STOP 43 |
| 224 |
if (a1(4) .ne. 10) STOP 44 |
| 225 |
if (a1(5) .ne. 10) STOP 45 |
| 226 |
|
| 227 |
deallocate(a1) |
| 228 |
|
| 229 |
end program test |