1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
! RUN: %python %S/../test_errors.py %s %flang -fopenacc
! Check OpenACC clause validity for the following construct and directive:
! 2.6.5 Data
! 2.14.6 Enter Data
! 2.14.7 Exit Data
program openacc_data_validity
implicit none
type atype
real(8), dimension(10) :: arr
real(8) :: s
end type atype
integer :: i, j, b, gang_size, vector_size, worker_size
integer, parameter :: N = 256
integer, dimension(N) :: c
logical, dimension(N) :: d, e
integer :: async1
integer :: wait1, wait2
real :: reduction_r
logical :: reduction_l
real(8), dimension(N, N) :: aa, bb, cc
real(8), dimension(:), allocatable :: dd
real(8), pointer :: p
logical :: ifCondition = .TRUE.
type(atype) :: t
type(atype), dimension(10) :: ta
real(8), dimension(N) :: a, f, g, h
!ERROR: At least one of ATTACH, COPYIN, CREATE clause must appear on the ENTER DATA directive
!$acc enter data
!ERROR: Modifier is not allowed for the COPYIN clause on the ENTER DATA directive
!$acc enter data copyin(zero: i)
!ERROR: Only the ZERO modifier is allowed for the CREATE clause on the ENTER DATA directive
!$acc enter data create(readonly: i)
!ERROR: COPYOUT clause is not allowed on the ENTER DATA directive
!$acc enter data copyin(i) copyout(i)
!$acc enter data create(aa) if(.TRUE.)
!ERROR: At most one IF clause can appear on the ENTER DATA directive
!$acc enter data create(aa) if(.TRUE.) if(ifCondition)
!$acc enter data create(aa) if(ifCondition)
!$acc enter data create(aa) async
!ERROR: At most one ASYNC clause can appear on the ENTER DATA directive
!$acc enter data create(aa) async async
!$acc enter data create(aa) async(async1)
!$acc enter data create(aa) async(1)
!$acc enter data create(aa) wait(1)
!$acc enter data create(aa) wait(wait1)
!$acc enter data create(aa) wait(wait1, wait2)
!$acc enter data create(aa) wait(wait1) wait(wait2)
!ERROR: Argument `bb` on the ATTACH clause must be a variable or array with the POINTER or ALLOCATABLE attribute
!$acc enter data attach(bb)
!ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive
!$acc exit data
!ERROR: Modifier is not allowed for the COPYOUT clause on the EXIT DATA directive
!$acc exit data copyout(zero: i)
!$acc exit data delete(aa)
!$acc exit data delete(aa) finalize
!ERROR: At most one FINALIZE clause can appear on the EXIT DATA directive
!$acc exit data delete(aa) finalize finalize
!ERROR: Argument `cc` on the DETACH clause must be a variable or array with the POINTER or ALLOCATABLE attribute
!$acc exit data detach(cc)
!ERROR: Argument on the DETACH clause must be a variable or array with the POINTER or ALLOCATABLE attribute
!$acc exit data detach(/i/)
!$acc exit data copyout(bb)
!$acc exit data delete(aa) if(.TRUE.)
!$acc exit data delete(aa) if(ifCondition)
!ERROR: At most one IF clause can appear on the EXIT DATA directive
!$acc exit data delete(aa) if(ifCondition) if(.TRUE.)
!$acc exit data delete(aa) async
!ERROR: At most one ASYNC clause can appear on the EXIT DATA directive
!$acc exit data delete(aa) async async
!$acc exit data delete(aa) async(async1)
!$acc exit data delete(aa) async(1)
!$acc exit data delete(aa) wait(1)
!$acc exit data delete(aa) wait(wait1)
!$acc exit data delete(aa) wait(wait1, wait2)
!$acc exit data delete(aa) wait(wait1) wait(wait2)
!ERROR: Only the ZERO modifier is allowed for the COPYOUT clause on the DATA directive
!$acc data copyout(readonly: i)
!$acc end data
!ERROR: At most one IF clause can appear on the DATA directive
!$acc data copy(i) if(.true.) if(.true.)
!$acc end data
!ERROR: At least one of COPYOUT, DELETE, DETACH clause must appear on the EXIT DATA directive
!$acc exit data
!ERROR: At least one of ATTACH, COPY, COPYIN, COPYOUT, CREATE, DEFAULT, DEVICEPTR, NO_CREATE, PRESENT clause must appear on the DATA directive
!$acc data
!$acc end data
!$acc data copy(aa) if(.true.)
!$acc end data
!$acc data copy(aa) if(ifCondition)
!$acc end data
!$acc data copy(aa, bb, cc)
!$acc end data
!$acc data copyin(aa) copyin(readonly: bb) copyout(cc)
!$acc end data
!$acc data copyin(readonly: aa, bb) copyout(zero: cc)
!$acc end data
!$acc data create(aa, bb(:,:)) create(zero: cc(:,:))
!$acc end data
!$acc data no_create(aa) present(bb, cc)
!$acc end data
!$acc data deviceptr(aa) attach(dd, p)
!$acc end data
!$acc data copy(aa, bb) default(none)
!$acc end data
!$acc data copy(aa, bb) default(present)
!$acc end data
!ERROR: At most one DEFAULT clause can appear on the DATA directive
!$acc data copy(aa, bb) default(none) default(present)
!$acc end data
!ERROR: At most one IF clause can appear on the DATA directive
!$acc data copy(aa) if(.true.) if(ifCondition)
!$acc end data
!$acc data copyin(i)
!ERROR: Unmatched PARALLEL directive
!$acc end parallel
end program openacc_data_validity
|