1 /* { dg-additional-options "-fopt-info-note-omp" }
2 { dg-additional-options "--param=openacc-privatization=noisy" }
3 { dg-additional-options "-foffload=-fopt-info-note-omp" }
4 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
5 for testing/documenting aspects of that functionality. */
9 #include <gomp-constants.h>
11 #define N (32*32*32+17)
18 int workersize
, vectorsize
;
20 for (ix
= 0; ix
< N
;ix
++)
25 #pragma acc parallel num_workers(NW) vector_length(VL) \
27 /* { dg-note {variable 'ix' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */
29 #pragma acc loop worker vector
30 /* { dg-note {variable 'ix' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
31 /* { dg-note {variable 'g' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */
32 /* { dg-note {variable 'w' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-3 } */
33 /* { dg-note {variable 'v' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-4 } */
34 for (unsigned ix
= 0; ix
< N
; ix
++)
36 if (acc_on_device (acc_device_not_host
))
40 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
41 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
42 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
43 ary
[ix
] = (g
<< 16) | (w
<< 8) | v
;
52 #ifdef ACC_DEVICE_TYPE_radeon
53 /* AMD GCN has an upper limit of 'num_workers(16)'. */
56 /* AMD GCN uses the autovectorizer for the vector dimension: the use
57 of a function call in vector-partitioned code in this test is not
58 currently supported. */
62 for (ix
= 0; ix
< N
; ix
++)
68 int w
= (ix
/ vectorsize
) % workersize
;
69 int v
= ix
% vectorsize
;
71 expected
= (g
<< 16) | (w
<< 8) | v
;
74 if (ary
[ix
] != expected
)
77 printf ("ary[%d]=%x expected %x\n", ix
, ary
[ix
], expected
);