2 ! { dg-additional-options "-w" }
7 integer, parameter :: n
= 40, c
= 10
8 integer :: i
, vsum
, gs
, ws
, vs
, cs
, ns
10 call redsub_gang (gs
, n
, c
)
11 call redsub_worker (ws
, n
, c
)
12 call redsub_vector (vs
, n
, c
)
13 call redsub_combined (cs
, n
, c
)
14 call redsub_nested (ns
, n
, c
)
23 if (gs
.ne
. vsum
) call abort ()
24 if (ws
.ne
. vsum
) call abort ()
25 if (vs
.ne
. vsum
) call abort ()
26 if (cs
.ne
. vsum
) call abort ()
27 if (ns
.ne
. vsum
) call abort ()
30 subroutine redsub_gang(sum
, n
, c
)
35 !$acc parallel copyin (n, c) num_gangs(n) copy(sum)
36 !$acc loop reduction(+:sum) gang
41 end subroutine redsub_gang
43 subroutine redsub_worker(sum
, n
, c
)
48 !$acc parallel copyin (n, c) num_workers(4) vector_length (32) copy(sum)
49 !$acc loop reduction(+:sum) worker
54 end subroutine redsub_worker
56 subroutine redsub_vector(sum
, n
, c
)
61 !$acc parallel copyin (n, c) vector_length(32) copy(sum)
62 !$acc loop reduction(+:sum) vector
67 end subroutine redsub_vector
69 subroutine redsub_combined(sum
, n
, c
)
74 !$acc parallel num_gangs (8) num_workers (4) vector_length(32) copy(sum)
75 !$acc loop reduction(+:sum) gang worker vector
80 end subroutine redsub_combined
82 subroutine redsub_nested(sum
, n
, c
)
90 !$acc parallel num_gangs (8) copy(sum)
91 !$acc loop reduction(+:sum) gang
93 !$acc loop reduction(+:sum) vector
99 end subroutine redsub_nested