Debian Codegraph @

gcc/testsuite/gfortran.dg/goacc/orphan-reductions-3.f90

raw
1 ! Verify that the error message for gang reductions on orphaned OpenACC loops
2 ! is not reported for non-orphaned loops.
3
4 ! { dg-additional-options "-Wopenacc-parallelism" }
5
6 subroutine kernels
7 implicit none
8
9 integer, parameter :: n = 100
10 integer :: i, sum
11 sum = 0
12
13 !$acc kernels
14 !$acc loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
15 do i = 1, n
16 sum = sum + 1
17 end do
18 !$acc end kernels
19 end subroutine kernels
20
21 subroutine parallel
22 implicit none
23
24 integer, parameter :: n = 100
25 integer :: i, sum
26 sum = 0
27
28 !$acc parallel
29 !$acc loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
30 do i = 1, n
31 sum = sum + 1
32 end do
33 !$acc end parallel
34 end subroutine parallel
35
36 subroutine serial
37 implicit none
38
39 integer, parameter :: n = 100
40 integer :: i, sum
41 sum = 0
42
43 !$acc serial ! { dg-warning "region contains gang partitioned code but is not gang partitioned" }
44 !$acc loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
45 do i = 1, n
46 sum = sum + 1
47 end do
48 !$acc end serial
49 end subroutine serial
50
51 subroutine kernels_combined
52 implicit none
53
54 integer, parameter :: n = 100
55 integer :: i, sum
56 sum = 0
57
58 !$acc kernels loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
59 do i = 1, n
60 sum = sum + 1
61 end do
62 end subroutine kernels_combined
63
64 subroutine parallel_combined
65 implicit none
66
67 integer, parameter :: n = 100
68 integer :: i, sum
69 sum = 0
70
71 !$acc parallel loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
72 do i = 1, n
73 sum = sum + 1
74 end do
75 end subroutine parallel_combined
76
77 subroutine serial_combined
78 implicit none
79
80 integer, parameter :: n = 100
81 integer :: i, sum
82 sum = 0
83
84 !$acc serial loop gang reduction(+:sum) ! { dg-bogus "gang reduction on an orphan loop" }
85 ! { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-1 }
86 do i = 1, n
87 sum = sum + 1
88 end do
89 end subroutine serial_combined