| 1 |
/* { dg-do run { target openacc_nvidia_accel_selected } } |
| 2 |
{ dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */ |
| 3 |
/* { dg-additional-options "-foffload=-fdump-rtl-mach" } */ |
| 4 |
|
| 5 |
/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting |
| 6 |
aspects of that functionality. */ |
| 7 |
|
| 8 |
int a; |
| 9 |
#pragma acc declare create(a) |
| 10 |
|
| 11 |
#pragma acc routine vector |
| 12 |
/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+2 } */ |
| 13 |
void __attribute__((noinline, noclone)) |
| 14 |
foo_v (void) |
| 15 |
{ |
| 16 |
a = 1; |
| 17 |
} |
| 18 |
|
| 19 |
#pragma acc routine worker |
| 20 |
/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .+3 } |
| 21 |
{ dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+2 } */ |
| 22 |
void __attribute__((noinline, noclone)) |
| 23 |
foo_w (void) |
| 24 |
{ |
| 25 |
a = 2; |
| 26 |
} |
| 27 |
|
| 28 |
int |
| 29 |
main (void) |
| 30 |
{ |
| 31 |
|
| 32 |
#pragma acc parallel |
| 33 |
foo_v (); |
| 34 |
|
| 35 |
#pragma acc parallel |
| 36 |
foo_w (); |
| 37 |
|
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
/* { dg-final { scan-offload-rtl-dump-not "nvptx_barsync" "mach" } } */ |