OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.fortran/] [reduction1.f90] - Blame information for rev 791

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 735 jeremybenn
! { dg-do run }
2
!$ use omp_lib
3
 
4
  integer :: i, ia (6), n, cnt
5
  real :: r, ra (4)
6
  double precision :: d, da (5)
7
  complex :: c, ca (3)
8
  logical :: v
9
 
10
  i = 1
11
  ia = 2
12
  r = 3
13
  ra = 4
14
  d = 5.5
15
  da = 6.5
16
  c = cmplx (7.5, 1.5)
17
  ca = cmplx (8.5, -3.0)
18
  v = .false.
19
  cnt = -1
20
 
21
!$omp parallel num_threads (3) private (n) reduction (.or.:v) &
22
!$omp & reduction (+:i, ia, r, ra, d, da, c, ca)
23
!$ if (i .ne. 0 .or. any (ia .ne. 0)) v = .true.
24
!$ if (r .ne. 0 .or. any (ra .ne. 0)) v = .true.
25
!$ if (d .ne. 0 .or. any (da .ne. 0)) v = .true.
26
!$ if (c .ne. cmplx (0) .or. any (ca .ne. cmplx (0))) v = .true.
27
  n = omp_get_thread_num ()
28
  if (n .eq. 0) then
29
    cnt = omp_get_num_threads ()
30
    i = 4
31
    ia(3:5) = -2
32
    r = 5
33
    ra(1:2) = 6.5
34
    d = -2.5
35
    da(2:4) = 8.5
36
    c = cmplx (2.5, -3.5)
37
    ca(1) = cmplx (4.5, 5)
38
  else if (n .eq. 1) then
39
    i = 2
40
    ia(4:6) = 5
41
    r = 1
42
    ra(2:4) = -1.5
43
    d = 8.5
44
    da(1:3) = 2.5
45
    c = cmplx (0.5, -3)
46
    ca(2:3) = cmplx (-1, 6)
47
  else
48
    i = 1
49
    ia = 1
50
    r = -1
51
    ra = -1
52
    d = 1
53
    da = -1
54
    c = 1
55
    ca = cmplx (-1, 0)
56
  end if
57
!$omp end parallel
58
  if (v) call abort
59
  if (cnt .eq. 3) then
60
    if (i .ne. 8 .or. any (ia .ne. (/3, 3, 1, 6, 6, 8/))) call abort
61
    if (r .ne. 8 .or. any (ra .ne. (/9.5, 8.0, 1.5, 1.5/))) call abort
62
    if (d .ne. 12.5 .or. any (da .ne. (/8.0, 16.5, 16.5, 14.0, 5.5/))) call abort
63
    if (c .ne. cmplx (11.5, -5)) call abort
64
    if (ca(1) .ne. cmplx (12, 2)) call abort
65
    if (ca(2) .ne. cmplx (6.5, 3) .or. ca(2) .ne. ca(3)) call abort
66
  end if
67
 
68
  i = 1
69
  ia = 2
70
  r = 3
71
  ra = 4
72
  d = 5.5
73
  da = 6.5
74
  c = cmplx (7.5, 1.5)
75
  ca = cmplx (8.5, -3.0)
76
  v = .false.
77
  cnt = -1
78
 
79
!$omp parallel num_threads (3) private (n) reduction (.or.:v) &
80
!$omp & reduction (-:i, ia, r, ra, d, da, c, ca)
81
!$ if (i .ne. 0 .or. any (ia .ne. 0)) v = .true.
82
!$ if (r .ne. 0 .or. any (ra .ne. 0)) v = .true.
83
!$ if (d .ne. 0 .or. any (da .ne. 0)) v = .true.
84
!$ if (c .ne. cmplx (0) .or. any (ca .ne. cmplx (0))) v = .true.
85
  n = omp_get_thread_num ()
86
  if (n .eq. 0) then
87
    cnt = omp_get_num_threads ()
88
    i = 4
89
    ia(3:5) = -2
90
    r = 5
91
    ra(1:2) = 6.5
92
    d = -2.5
93
    da(2:4) = 8.5
94
    c = cmplx (2.5, -3.5)
95
    ca(1) = cmplx (4.5, 5)
96
  else if (n .eq. 1) then
97
    i = 2
98
    ia(4:6) = 5
99
    r = 1
100
    ra(2:4) = -1.5
101
    d = 8.5
102
    da(1:3) = 2.5
103
    c = cmplx (0.5, -3)
104
    ca(2:3) = cmplx (-1, 6)
105
  else
106
    i = 1
107
    ia = 1
108
    r = -1
109
    ra = -1
110
    d = 1
111
    da = -1
112
    c = 1
113
    ca = cmplx (-1, 0)
114
  end if
115
!$omp end parallel
116
  if (v) call abort
117
  if (cnt .eq. 3) then
118
    if (i .ne. 8 .or. any (ia .ne. (/3, 3, 1, 6, 6, 8/))) call abort
119
    if (r .ne. 8 .or. any (ra .ne. (/9.5, 8.0, 1.5, 1.5/))) call abort
120
    if (d .ne. 12.5 .or. any (da .ne. (/8.0, 16.5, 16.5, 14.0, 5.5/))) call abort
121
    if (c .ne. cmplx (11.5, -5)) call abort
122
    if (ca(1) .ne. cmplx (12, 2)) call abort
123
    if (ca(2) .ne. cmplx (6.5, 3) .or. ca(2) .ne. ca(3)) call abort
124
  end if
125
 
126
  i = 1
127
  ia = 2
128
  r = 4
129
  ra = 8
130
  d = 16
131
  da = 32
132
  c = 2
133
  ca = cmplx (0, 2)
134
  v = .false.
135
  cnt = -1
136
 
137
!$omp parallel num_threads (3) private (n) reduction (.or.:v) &
138
!$omp & reduction (*:i, ia, r, ra, d, da, c, ca)
139
!$ if (i .ne. 1 .or. any (ia .ne. 1)) v = .true.
140
!$ if (r .ne. 1 .or. any (ra .ne. 1)) v = .true.
141
!$ if (d .ne. 1 .or. any (da .ne. 1)) v = .true.
142
!$ if (c .ne. cmplx (1) .or. any (ca .ne. cmplx (1))) v = .true.
143
  n = omp_get_thread_num ()
144
  if (n .eq. 0) then
145
    cnt = omp_get_num_threads ()
146
    i = 3
147
    ia(3:5) = 2
148
    r = 0.5
149
    ra(1:2) = 2
150
    d = -1
151
    da(2:4) = -2
152
    c = 2.5
153
    ca(1) = cmplx (-5, 0)
154
  else if (n .eq. 1) then
155
    i = 2
156
    ia(4:6) = -2
157
    r = 8
158
    ra(2:4) = -0.5
159
    da(1:3) = -1
160
    c = -3
161
    ca(2:3) = cmplx (0, -1)
162
  else
163
    ia = 2
164
    r = 0.5
165
    ra = 0.25
166
    d = 2.5
167
    da = -1
168
    c = cmplx (0, -1)
169
    ca = cmplx (-1, 0)
170
  end if
171
!$omp end parallel
172
  if (v) call abort
173
  if (cnt .eq. 3) then
174
    if (i .ne. 6 .or. any (ia .ne. (/4, 4, 8, -16, -16, -8/))) call abort
175
    if (r .ne. 8 .or. any (ra .ne. (/4., -2., -1., -1./))) call abort
176
    if (d .ne. -40 .or. any (da .ne. (/32., -64., -64., 64., -32./))) call abort
177
    if (c .ne. cmplx (0, 15)) call abort
178
    if (ca(1) .ne. cmplx (0, 10)) call abort
179
    if (ca(2) .ne. cmplx (-2, 0) .or. ca(2) .ne. ca(3)) call abort
180
  end if
181
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.