| 1 |
! { dg-do compile } |
| 2 |
! { dg-additional-options "-fcoarray=lib" } |
| 3 |
! |
| 4 |
! PR fortran/63861 |
| 5 |
|
| 6 |
module test |
| 7 |
contains |
| 8 |
subroutine oacc1(a) |
| 9 |
implicit none |
| 10 |
integer :: i |
| 11 |
integer, codimension[*] :: a |
| 12 |
!$acc declare device_resident (a) |
| 13 |
!$acc data copy (a) |
| 14 |
!$acc end data |
| 15 |
!$acc data deviceptr (a) |
| 16 |
!$acc end data |
| 17 |
!$acc parallel private (a) |
| 18 |
!$acc end parallel |
| 19 |
!$acc serial private (a) |
| 20 |
!$acc end serial |
| 21 |
!$acc host_data use_device (a) |
| 22 |
!$acc end host_data |
| 23 |
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 24 |
do i = 1,5 |
| 25 |
enddo |
| 26 |
!$acc end parallel loop |
| 27 |
!$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 28 |
do i = 1,5 |
| 29 |
enddo |
| 30 |
!$acc end serial loop |
| 31 |
!$acc parallel loop |
| 32 |
do i = 1,5 |
| 33 |
enddo |
| 34 |
!$acc end parallel loop |
| 35 |
!$acc serial loop |
| 36 |
do i = 1,5 |
| 37 |
enddo |
| 38 |
!$acc end serial loop |
| 39 |
!$acc update device (a) |
| 40 |
!$acc update host (a) |
| 41 |
!$acc update self (a) |
| 42 |
end subroutine oacc1 |
| 43 |
|
| 44 |
subroutine oacc2(a) |
| 45 |
implicit none |
| 46 |
integer :: i |
| 47 |
integer, allocatable, codimension[:] :: a |
| 48 |
!$acc declare device_resident (a) |
| 49 |
!$acc data copy (a) |
| 50 |
!$acc end data |
| 51 |
!$acc parallel private (a) |
| 52 |
!$acc end parallel |
| 53 |
!$acc serial private (a) |
| 54 |
!$acc end serial |
| 55 |
! FIXME: |
| 56 |
! !$acc parallel loop reduction(+:a) |
| 57 |
! This involves an assignment, which shall not reallocate |
| 58 |
! the LHS variable. Version without reduction: |
| 59 |
!$acc parallel loop |
| 60 |
do i = 1,5 |
| 61 |
enddo |
| 62 |
!$acc end parallel loop |
| 63 |
! FIXME: |
| 64 |
! !$acc serial loop reduction(+:a) |
| 65 |
! This involves an assignment, which shall not reallocate |
| 66 |
! the LHS variable. Version without reduction: |
| 67 |
!$acc serial loop |
| 68 |
do i = 1,5 |
| 69 |
enddo |
| 70 |
!$acc end serial loop |
| 71 |
!$acc parallel loop |
| 72 |
do i = 1,5 |
| 73 |
enddo |
| 74 |
!$acc end parallel loop |
| 75 |
!$acc serial loop |
| 76 |
do i = 1,5 |
| 77 |
enddo |
| 78 |
!$acc end serial loop |
| 79 |
!$acc update device (a) |
| 80 |
!$acc update host (a) |
| 81 |
!$acc update self (a) |
| 82 |
end subroutine oacc2 |
| 83 |
|
| 84 |
subroutine oacc3(a) |
| 85 |
implicit none |
| 86 |
integer :: i |
| 87 |
integer, codimension[*] :: a(:) |
| 88 |
!$acc declare device_resident (a) |
| 89 |
!$acc data copy (a) |
| 90 |
!$acc end data |
| 91 |
!$acc data deviceptr (a) |
| 92 |
!$acc end data |
| 93 |
!$acc parallel private (a) |
| 94 |
!$acc end parallel |
| 95 |
!$acc serial private (a) |
| 96 |
!$acc end serial |
| 97 |
!$acc host_data use_device (a) |
| 98 |
!$acc end host_data |
| 99 |
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 100 |
do i = 1,5 |
| 101 |
enddo |
| 102 |
!$acc end parallel loop |
| 103 |
!$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 104 |
do i = 1,5 |
| 105 |
enddo |
| 106 |
!$acc end serial loop |
| 107 |
!$acc parallel loop |
| 108 |
do i = 1,5 |
| 109 |
enddo |
| 110 |
!$acc end parallel loop |
| 111 |
!$acc serial loop |
| 112 |
do i = 1,5 |
| 113 |
enddo |
| 114 |
!$acc end serial loop |
| 115 |
!$acc update device (a) |
| 116 |
!$acc update host (a) |
| 117 |
!$acc update self (a) |
| 118 |
end subroutine oacc3 |
| 119 |
|
| 120 |
subroutine oacc4(a) |
| 121 |
implicit none |
| 122 |
integer :: i |
| 123 |
integer, allocatable, codimension[:] :: a(:) |
| 124 |
!$acc declare device_resident (a) |
| 125 |
!$acc data copy (a) |
| 126 |
!$acc end data |
| 127 |
!$acc parallel private (a) |
| 128 |
!$acc end parallel |
| 129 |
!$acc serial private (a) |
| 130 |
!$acc end serial |
| 131 |
!$acc parallel loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 132 |
do i = 1,5 |
| 133 |
enddo |
| 134 |
!$acc end parallel loop |
| 135 |
!$acc serial loop reduction(+:a) ! { dg-error "Array 'a' is not permitted in reduction" } |
| 136 |
do i = 1,5 |
| 137 |
enddo |
| 138 |
!$acc end serial loop |
| 139 |
!$acc parallel loop |
| 140 |
do i = 1,5 |
| 141 |
enddo |
| 142 |
!$acc end parallel loop |
| 143 |
!$acc serial loop |
| 144 |
do i = 1,5 |
| 145 |
enddo |
| 146 |
!$acc end serial loop |
| 147 |
!$acc update device (a) |
| 148 |
!$acc update host (a) |
| 149 |
!$acc update self (a) |
| 150 |
end subroutine oacc4 |
| 151 |
end module test |