2 ! { dg-additional-options "-cpp" }
4 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
5 ! aspects of that functionality.
10 integer, parameter :: n
= 100, n2
= 1000, chunksize
= 10
11 integer :: i
, gs1
, gs2
, ws1
, ws2
, vs1
, vs2
, cs1
, cs2
, hs1
, hs2
12 integer :: j
, red
, vred
25 !$acc parallel num_gangs (1000)
26 !$acc loop reduction(+:gs1, gs2) gang
33 !$acc parallel num_workers (4) vector_length (32)
34 ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
35 !$acc loop reduction(+:ws1, ws2) worker
42 !$acc parallel vector_length (32)
43 !$acc loop reduction(+:vs1, vs2) vector
50 !$acc parallel num_gangs(8) num_workers(4) vector_length(32)
51 !$acc loop reduction(+:cs1, cs2) gang worker vector
58 ! Verify the results on the host
64 if (gs1
.ne
. hs1
) STOP 1
65 if (gs2
.ne
. hs2
) STOP 2
67 if (ws1
.ne
. hs1
) STOP 3
68 if (ws2
.ne
. hs2
) STOP 4
70 if (vs1
.ne
. hs1
) STOP 5
71 if (vs2
.ne
. hs2
) STOP 6
73 if (cs1
.ne
. hs1
) STOP 7
74 if (cs2
.ne
. hs2
) STOP 8
81 !$acc parallel num_gangs(10) vector_length(32)
82 !$acc loop reduction(+:red) gang
84 !$acc loop reduction(+:red) vector
93 vred
= vred
+ chunksize
97 if (red
.ne
. vred
) STOP 9