| 1 |
/* Ensure that routines with a certain level of parallelism can be called. */ |
| 2 |
|
| 3 |
/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting |
| 4 |
aspects of that functionality. */ |
| 5 |
|
| 6 |
#pragma acc routine gang |
| 7 |
/* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .+3 } |
| 8 |
{ dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .+2 } |
| 9 |
{ dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */ |
| 10 |
void gang (void) |
| 11 |
{ |
| 12 |
} |
| 13 |
|
| 14 |
#pragma acc routine worker |
| 15 |
/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .+2 } |
| 16 |
{ dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */ |
| 17 |
void worker (void) |
| 18 |
{ |
| 19 |
} |
| 20 |
|
| 21 |
#pragma acc routine vector |
| 22 |
/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */ |
| 23 |
void vector (void) |
| 24 |
{ |
| 25 |
} |
| 26 |
|
| 27 |
#pragma acc routine seq |
| 28 |
void seq (void) |
| 29 |
{ |
| 30 |
} |
| 31 |
|
| 32 |
int main () |
| 33 |
{ |
| 34 |
#pragma acc kernels num_gangs (32) num_workers (32) vector_length (32) |
| 35 |
{ |
| 36 |
gang (); |
| 37 |
worker (); |
| 38 |
vector (); |
| 39 |
seq (); |
| 40 |
} |
| 41 |
|
| 42 |
#pragma acc parallel num_gangs (32) num_workers (32) vector_length (32) |
| 43 |
{ |
| 44 |
gang (); |
| 45 |
worker (); |
| 46 |
vector (); |
| 47 |
seq (); |
| 48 |
} |
| 49 |
|
| 50 |
#pragma acc serial |
| 51 |
/* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-1 } |
| 52 |
{ dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 } |
| 53 |
{ dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-3 } */ |
| 54 |
{ |
| 55 |
gang (); |
| 56 |
worker (); |
| 57 |
vector (); |
| 58 |
seq (); |
| 59 |
} |
| 60 |
|
| 61 |
return 0; |
| 62 |
} |