| 1 |
/* Test various aspects of clauses specifying compatible levels of parallelism |
| 2 |
with the OpenACC 'routine' directive. The Fortran counterpart is |
| 3 |
'../../gfortran.dg/goacc/routine-level-of-parallelism-1.f90'. */ |
| 4 |
|
| 5 |
/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting |
| 6 |
aspects of that functionality. */ |
| 7 |
|
| 8 |
#pragma acc routine gang |
| 9 |
/* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .+3 } |
| 10 |
{ dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .+2 } |
| 11 |
{ dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */ |
| 12 |
void g_1 (void) |
| 13 |
{ |
| 14 |
} |
| 15 |
#pragma acc routine (g_1) gang |
| 16 |
#pragma acc routine (g_1) gang |
| 17 |
|
| 18 |
|
| 19 |
extern void w_1 (void); |
| 20 |
#pragma acc routine (w_1) worker |
| 21 |
#pragma acc routine (w_1) worker |
| 22 |
#pragma acc routine (w_1) worker |
| 23 |
|
| 24 |
|
| 25 |
#pragma acc routine vector |
| 26 |
extern void v_1 (void); |
| 27 |
#pragma acc routine (v_1) vector |
| 28 |
#pragma acc routine (v_1) vector |
| 29 |
|
| 30 |
|
| 31 |
/* Also test the implicit seq clause. */ |
| 32 |
|
| 33 |
#pragma acc routine seq |
| 34 |
extern void s_1_1 (void); |
| 35 |
#pragma acc routine (s_1_1) |
| 36 |
#pragma acc routine (s_1_1) seq |
| 37 |
#pragma acc routine (s_1_1) |
| 38 |
#pragma acc routine (s_1_1) seq |
| 39 |
|
| 40 |
#pragma acc routine |
| 41 |
extern void s_1_2 (void); |
| 42 |
#pragma acc routine (s_1_2) |
| 43 |
#pragma acc routine (s_1_2) seq |
| 44 |
#pragma acc routine (s_1_2) |
| 45 |
#pragma acc routine (s_1_2) seq |
| 46 |
|
| 47 |
extern void s_2_1 (void); |
| 48 |
#pragma acc routine (s_2_1) seq |
| 49 |
#pragma acc routine (s_2_1) |
| 50 |
#pragma acc routine (s_2_1) seq |
| 51 |
#pragma acc routine (s_2_1) |
| 52 |
#pragma acc routine (s_2_1) seq |
| 53 |
|
| 54 |
extern void s_2_2 (void); |
| 55 |
#pragma acc routine (s_2_2) |
| 56 |
#pragma acc routine (s_2_2) |
| 57 |
#pragma acc routine (s_2_2) seq |
| 58 |
#pragma acc routine (s_2_2) |
| 59 |
#pragma acc routine (s_2_2) seq |
| 60 |
|
| 61 |
#pragma acc routine seq |
| 62 |
void s_3_1 (void) |
| 63 |
{ |
| 64 |
} |
| 65 |
#pragma acc routine (s_3_1) |
| 66 |
#pragma acc routine (s_3_1) seq |
| 67 |
#pragma acc routine (s_3_1) |
| 68 |
#pragma acc routine (s_3_1) seq |
| 69 |
|
| 70 |
#pragma acc routine |
| 71 |
void s_3_2 (void) |
| 72 |
{ |
| 73 |
} |
| 74 |
#pragma acc routine (s_3_2) |
| 75 |
#pragma acc routine (s_3_2) seq |
| 76 |
#pragma acc routine (s_3_2) |
| 77 |
#pragma acc routine (s_3_2) seq |