1! Test invalid intra-routine parallellism.
2
3module param
4  integer, parameter :: N = 32
5end module param
6
7subroutine gang (a)
8  use param
9  !$acc routine gang
10  integer, intent (inout) :: a(N)
11  integer :: i
12
13  !$acc loop
14  do i = 1, N
15     a(i) = a(i) - a(i)
16  end do
17
18  !$acc loop gang
19  do i = 1, N
20     a(i) = a(i) - a(i)
21  end do
22
23  !$acc loop worker
24  do i = 1, N
25     a(i) = a(i) - a(i)
26  end do
27
28  !$acc loop vector
29  do i = 1, N
30     a(i) = a(i) - a(i)
31  end do
32end subroutine gang
33
34subroutine worker (a)
35  use param
36  !$acc routine worker
37  integer, intent (inout) :: a(N)
38  integer :: i
39
40  !$acc loop
41  do i = 1, N
42     a(i) = a(i) - a(i)
43  end do
44
45  !$acc loop gang ! { dg-error "disallowed by containing routine" }
46  do i = 1, N
47     a(i) = a(i) - a(i)
48  end do
49
50  !$acc loop worker
51  do i = 1, N
52     a(i) = a(i) - a(i)
53  end do
54
55  !$acc loop vector
56  do i = 1, N
57     a(i) = a(i) - a(i)
58  end do
59end subroutine worker
60
61subroutine vector (a)
62  use param
63  !$acc routine vector
64  integer, intent (inout) :: a(N)
65  integer :: i
66
67  !$acc loop
68  do i = 1, N
69     a(i) = a(i) - a(i)
70  end do
71
72  !$acc loop gang  ! { dg-error "disallowed by containing routine" }
73  do i = 1, N
74     a(i) = a(i) - a(i)
75  end do
76
77  !$acc loop worker ! { dg-error "disallowed by containing routine" }
78  do i = 1, N
79     a(i) = a(i) - a(i)
80  end do
81
82  !$acc loop vector
83  do i = 1, N
84     a(i) = a(i) - a(i)
85  end do
86end subroutine vector
87
88subroutine seq (a)
89  use param
90  !$acc routine seq
91  integer, intent (inout) :: a(N)
92  integer :: i
93
94  !$acc loop ! { dg-warning "insufficient partitioning" }
95  do i = 1, N
96     a(i) = a(i) - a(i)
97  end do
98
99  !$acc loop gang ! { dg-error "disallowed by containing routine" }
100  do i = 1, N
101     a(i) = a(i) - a(i)
102  end do
103
104  !$acc loop worker ! { dg-error "disallowed by containing routine" }
105  do i = 1, N
106     a(i) = a(i) - a(i)
107  end do
108
109  !$acc loop vector ! { dg-error "disallowed by containing routine" }
110  do i = 1, N
111     a(i) = a(i) - a(i)
112  end do
113end subroutine seq
114