2 ! { dg-additional-options "-cpp -w" }
7 integer, parameter :: n
= 100, n2
= 1000, chunksize
= 10
8 integer :: i
, gs1
, gs2
, ws1
, ws2
, vs1
, vs2
, cs1
, cs2
, hs1
, hs2
9 integer :: j
, red
, vred
22 !$acc parallel num_gangs (1000)
23 !$acc loop reduction(+:gs1, gs2) gang
30 !$acc parallel num_workers (4) vector_length (32)
31 !$acc loop reduction(+:ws1, ws2) worker
38 !$acc parallel vector_length (32)
39 !$acc loop reduction(+:vs1, vs2) vector
46 !$acc parallel num_gangs(8) num_workers(4) vector_length(32)
47 !$acc loop reduction(+:cs1, cs2) gang worker vector
54 ! Verify the results on the host
60 if (gs1
.ne
. hs1
) STOP 1
61 if (gs2
.ne
. hs2
) STOP 2
63 if (ws1
.ne
. hs1
) STOP 3
64 if (ws2
.ne
. hs2
) STOP 4
66 if (vs1
.ne
. hs1
) STOP 5
67 if (vs2
.ne
. hs2
) STOP 6
69 if (cs1
.ne
. hs1
) STOP 7
70 if (cs2
.ne
. hs2
) STOP 8
77 !$acc parallel num_gangs(10) vector_length(32)
78 !$acc loop reduction(+:red) gang
80 !$acc loop reduction(+:red) vector
89 vred
= vred
+ chunksize
93 if (red
.ne
. vred
) STOP 9