2 ! { dg-additional-options "-msse2" { target sse2_runtime } }
3 ! { dg-additional-options "-mavx" { target avx_runtime } }
6 subroutine foo (b
, i
, j
, x
)
7 integer, intent (inout
) :: b
8 integer, intent (in
) :: i
, j
, x
16 !$omp simd linear(b:2) reduction(+:c)
18 c
= c
+ b
- (7 + 2 * i
)
21 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 64 * 2) STOP 1
25 !$omp simd linear(b:3) reduction(+:c)
27 c
= c
+ b
- (7 + i
/ 4 * 3)
30 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 16 * 3) STOP 2
34 !$omp simd linear(i) linear(b:2) reduction(+:c)
36 c
= c
+ b
- (7 + 2 * i
)
39 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 64 * 2) STOP 3
43 !$omp simd linear(i:4) linear(b:3) reduction(+:c)
45 c
= c
+ b
- (7 + i
/ 4 * 3)
48 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 16 * 3) STOP 4
52 !$omp simd collapse(2) linear(b:2) reduction(+:c)
55 c
= c
+ b
- (7 + 2 * j
+ 2 * 8 * i
)
59 if (c
/= 0 .or
. i
/= 8 .or
. j
/= 8 .or
. b
/= 7 + 64 * 2) STOP 5
63 !$omp simd collapse(2) linear(b:2) reduction(+:c) lastprivate (i, j)
66 c
= c
+ b
- (7 + 2 * j
+ 2 * 8 * i
)
70 if (c
/= 0 .or
. i
/= 8 .or
. j
/= 8 .or
. b
/= 7 + 64 * 2) STOP 6
74 !$omp parallel do simd schedule (static, 4) linear(b:2) reduction(+:c)
76 c
= c
+ b
- (7 + 2 * i
)
79 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 64 * 2) STOP 7
83 !$omp parallel do simd schedule (static, 4) linear(b:3) reduction(+:c)
85 c
= c
+ b
- (7 + i
/ 4 * 3)
88 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 16 * 3) STOP 8
92 !$omp parallel do simd schedule (static, 4) linear(i) linear(b:2) reduction(+:c)
94 c
= c
+ b
- (7 + 2 * i
)
97 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 64 * 2) STOP 9
101 !$omp parallel do simd schedule (static, 4) linear(i:4) linear(b:3) reduction(+:c)
103 c
= c
+ b
- (7 + i
/ 4 * 3)
104 call foo (b
, i
, j
, 3)
106 if (c
/= 0 .or
. i
/= 64 .or
. b
/= 7 + 16 * 3) STOP 10
110 !$omp parallel do simd schedule (static, 4) collapse(2) linear(b:2) reduction(+:c)
113 c
= c
+ b
- (7 + 2 * j
+ 2 * 8 * i
)
114 call foo (b
, i
, j
, 2)
117 if (c
/= 0 .or
. i
/= 8 .or
. j
/= 8 .or
. b
/= 7 + 64 * 2) STOP 11
121 !$omp parallel do simd schedule (static, 4) collapse(2) linear(b:2) &
122 !$omp & reduction(+:c) lastprivate (i, j)
125 c
= c
+ b
- (7 + 2 * j
+ 2 * 8 * i
)
126 call foo (b
, i
, j
, 2)
129 if (c
/= 0 .or
. i
/= 8 .or
. j
/= 8 .or
. b
/= 7 + 64 * 2) STOP 12
131 subroutine foo (b
, i
, j
, x
)
132 integer, intent (inout
) :: b
133 integer, intent (in
) :: i
, j
, x
134 b
= b
+ (i
- i
) + (j
- j
) + x