1 ! Test of reduction on parallel directive
(with async
).
2 ! Variant of
"../libgomp.oacc-c-c++-common/par-reduction-2.c".
3 ! Variant using
"openacc_lib.h".
7 ! { dg
-additional
-options
"-Wopenacc-parallelism" } for
8 ! testing
/documenting aspects of that functionality
.
12 INCLUDE
"openacc_lib.h"
14 INTEGER RES
, RES1
, RES2
19 !$ACC PARALLEL NUM_GANGS
(256) NUM_WORKERS
(32) VECTOR_LENGTH
(32)
20 !$ACC
& REDUCTION
(+:RES1
) COPY
(RES1
, RES2
) ASYNC
(1)
21 ! { dg
-bogus
"\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail
*-*-* } .-1 }
22 ! { dg
-warning
"region is worker partitioned but does not contain worker partitioned code" "" { target
*-*-* } .-2 }
23 ! { dg
-warning
"region is vector partitioned but does not contain vector partitioned code" "" { target
*-*-* } .-3 }
30 IF (ACC_GET_DEVICE_TYPE
() .EQ
. ACC_DEVICE_HOST
) THEN
36 CALL ACC_ASYNC_WAIT
(1)
38 IF (RES
.NE
. RES1
) STOP 1
39 IF (RES
.NE
. RES2
) STOP 2
44 !$ACC PARALLEL NUM_GANGS
(8) NUM_WORKERS
(32) VECTOR_LENGTH
(32)
45 !$ACC
& REDUCTION
(*:RES1
) COPY
(RES1
, RES2
) ASYNC
(1)
46 ! { dg
-bogus
"\[Ww\]arning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail
*-*-* } .-1 }
47 ! { dg
-warning
"region is worker partitioned but does not contain worker partitioned code" "" { target
*-*-* } .-2 }
48 ! { dg
-warning
"region is vector partitioned but does not contain vector partitioned code" "" { target
*-*-* } .-3 }
55 IF (ACC_GET_DEVICE_TYPE
() .EQ
. ACC_DEVICE_HOST
) THEN
61 CALL ACC_ASYNC_WAIT_ALL
63 IF (RES
.NE
. RES1
) STOP 3
64 IF (RES
.NE
. RES2
) STOP 4