1 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
2 aspects of that functionality. */
6 #include <gomp-constants.h>
8 #define N (32*32*32+17)
16 #pragma acc parallel num_workers(32) vector_length(32) copy(ondev) \
18 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
20 #pragma acc loop worker reduction(+:t)
21 for (unsigned ix
= 0; ix
< N
; ix
++)
25 if (acc_on_device (acc_device_not_host
))
29 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
30 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
31 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
32 val
= (g
<< 16) | (w
<< 8) | v
;
37 workersize
= __builtin_goacc_parlevel_size (GOMP_DIM_WORKER
);
40 for (ix
= 0; ix
< N
; ix
++)
46 int w
= ix
% workersize
;
49 val
= (g
<< 16) | (w
<< 8) | v
;
55 printf ("t=%x expected %x\n", t
, h
);