8 integer, parameter :: n = 10, vl = 2
9 integer :: i, vresult, result
10 logical :: lresult, lvresult
11 integer, dimension (n) :: array
22 !$acc parallel vector_length(vl) num_gangs(1)
23 !$acc loop reduction(+:result)
25 result = result + array(i)
31 vresult = vresult + array(i)
34 if (result.ne.vresult) call abort
41 !$acc parallel vector_length(vl) num_gangs(1)
42 !$acc loop reduction(*:result)
44 result = result * array(i)
50 vresult = vresult * array(i)
53 if (result.ne.vresult) call abort
60 !$acc parallel vector_length(vl) num_gangs(1)
61 !$acc loop reduction(max:result)
63 result = max (result, array(i))
69 vresult = max (vresult, array(i))
72 if (result.ne.vresult) call abort
79 !$acc parallel vector_length(vl) num_gangs(1)
80 !$acc loop reduction(min:result)
82 result = min (result, array(i))
88 vresult = min (vresult, array(i))
91 if (result.ne.vresult) call abort
98 !$acc parallel vector_length(vl) num_gangs(1)
99 !$acc loop reduction(iand:result)
101 result = iand (result, array(i))
107 vresult = iand (vresult, array(i))
110 if (result.ne.vresult) call abort
117 !$acc parallel vector_length(vl) num_gangs(1)
118 !$acc loop reduction(ior:result)
120 result = ior (result, array(i))
126 vresult = ior (vresult, array(i))
129 if (result.ne.vresult) call abort
136 !$acc parallel vector_length(vl) num_gangs(1)
137 !$acc loop reduction(ieor:result)
139 result = ieor (result, array(i))
145 vresult = ieor (vresult, array(i))
148 if (result.ne.vresult) call abort
155 !$acc parallel vector_length(vl) num_gangs(1)
156 !$acc loop reduction(.and.:lresult)
158 lresult = lresult .and. (array(i) .ge. 5)
164 lvresult = lvresult .and. (array(i) .ge. 5)
167 if (result.ne.vresult) call abort
174 !$acc parallel vector_length(vl) num_gangs(1)
175 !$acc loop reduction(.or.:lresult)
177 lresult = lresult .or. (array(i) .ge. 5)
183 lvresult = lvresult .or. (array(i) .ge. 5)
186 if (result.ne.vresult) call abort
193 !$acc parallel vector_length(vl) num_gangs(1)
194 !$acc loop reduction(.eqv.:lresult)
196 lresult = lresult .eqv. (array(i) .ge. 5)
202 lvresult = lvresult .eqv. (array(i) .ge. 5)
205 if (result.ne.vresult) call abort
210 ! '.neqv.' reductions
212 !$acc parallel vector_length(vl) num_gangs(1)
213 !$acc loop reduction(.neqv.:lresult)
215 lresult = lresult .neqv. (array(i) .ge. 5)
221 lvresult = lvresult .neqv. (array(i) .ge. 5)
224 if (result.ne.vresult) call abort
225 end program reduction_1