1 ! Test that optional arguments work in private clauses. The effect of
2 ! non-present arguments in private clauses is undefined, and is not tested
3 ! for. The tests are based on those in private-variables.f90.
7 ! { dg-additional-options "-fopt-info-note-omp" }
8 ! { dg-additional-options "--param=openacc-privatization=noisy" }
9 ! { dg-additional-options "-foffload=-fopt-info-note-omp" }
10 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
11 ! for testing/documenting aspects of that functionality.
13 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
14 ! aspects of that functionality.
21 integer x
, y
, z
, attr(13)
32 ! Test of gang-private variables declared on loop directive.
35 integer, optional
:: x
42 !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
43 ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
44 ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 }
45 !$acc loop gang private(x)
46 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
47 ! { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 }
55 if (arr(i
) .ne
. i
* 3) STOP 1
60 ! Test of gang-private addressable variable declared on loop directive, with
61 ! broadcasting to partitioned workers.
64 integer i
, j
, arr(0:32*32)
65 type(vec3
), optional
:: pt
71 !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
72 ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
73 !$acc loop gang private(pt)
74 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
75 ! { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 }
83 ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
85 arr(i
* 32 + j
) = arr(i
* 32 + j
) + pt
%x
+ pt
%y
+ pt
%z
+ pt
%attr(5);
91 if (arr(i
) .ne
. i
+ (i
/ 32) * 13) STOP 2
95 ! Test of vector-private variables declared on loop directive. Array type.
98 integer, optional
:: pt(2)
99 integer :: i
, j
, k
, idx
, arr(0:32*32*32)
105 !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
107 ! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
110 ! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
112 !$acc loop vector private(pt)
113 ! { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 }
114 ! { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 }
116 pt(1) = ieor(i
, j
* 3)
117 pt(2) = ior(i
, j
* 5)
118 arr(i
* 1024 + j
* 32 + k
) = arr(i
* 1024 + j
* 32 + k
) + pt(1) * k
119 arr(i
* 1024 + j
* 32 + k
) = arr(i
* 1024 + j
* 32 + k
) + pt(2) * k
128 idx
= i
* 1024 + j
* 32 + k
129 if (arr(idx
) .ne
. idx
+ ieor(i
, j
* 3) * k
+ ior(i
, j
* 5) * k
) then