| 1 |
extern int i; |
| 2 |
|
| 3 |
/* The OpenACC specification allows nested compute constructs, but we don't |
| 4 |
support that yet. */ |
| 5 |
|
| 6 |
void |
| 7 |
f_acc_parallel (void) |
| 8 |
{ |
| 9 |
#pragma acc parallel |
| 10 |
{ |
| 11 |
#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */ |
| 12 |
; |
| 13 |
#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */ |
| 14 |
; |
| 15 |
#pragma acc serial /* { dg-bogus ".serial. construct inside of .parallel. region" "not implemented" { xfail *-*-* } } */ |
| 16 |
; |
| 17 |
#pragma acc data /* { dg-error ".data. construct inside of .parallel. region" } */ |
| 18 |
; |
| 19 |
#pragma acc update host(i) /* { dg-error ".update. construct inside of .parallel. region" } */ |
| 20 |
#pragma acc enter data copyin(i) /* { dg-error ".enter data. construct inside of .parallel. region" } */ |
| 21 |
#pragma acc exit data delete(i) /* { dg-error ".exit data. construct inside of .parallel. region" } */ |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
void |
| 26 |
f_acc_kernels (void) |
| 27 |
{ |
| 28 |
#pragma acc kernels |
| 29 |
{ |
| 30 |
#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */ |
| 31 |
; |
| 32 |
#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */ |
| 33 |
; |
| 34 |
#pragma acc serial /* { dg-bogus ".serial. construct inside of .kernels. region" "not implemented" { xfail *-*-* } } */ |
| 35 |
; |
| 36 |
#pragma acc data /* { dg-error ".data. construct inside of .kernels. region" } */ |
| 37 |
; |
| 38 |
#pragma acc update host(i) /* { dg-error ".update. construct inside of .kernels. region" } */ |
| 39 |
#pragma acc enter data copyin(i) /* { dg-error ".enter data. construct inside of .kernels. region" } */ |
| 40 |
#pragma acc exit data delete(i) /* { dg-error ".exit data. construct inside of .kernels. region" } */ |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
void |
| 45 |
f_acc_serial (void) |
| 46 |
{ |
| 47 |
#pragma acc serial |
| 48 |
{ |
| 49 |
#pragma acc parallel /* { dg-bogus ".parallel. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */ |
| 50 |
; |
| 51 |
#pragma acc kernels /* { dg-bogus ".kernels. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */ |
| 52 |
; |
| 53 |
#pragma acc serial /* { dg-bogus ".serial. construct inside of .serial. region" "not implemented" { xfail *-*-* } } */ |
| 54 |
; |
| 55 |
#pragma acc data /* { dg-error ".data. construct inside of .serial. region" } */ |
| 56 |
; |
| 57 |
#pragma acc update host(i) /* { dg-error ".update. construct inside of .serial. region" } */ |
| 58 |
#pragma acc enter data copyin(i) /* { dg-error ".enter data. construct inside of .serial. region" } */ |
| 59 |
#pragma acc exit data delete(i) /* { dg-error ".exit data. construct inside of .serial. region" } */ |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
void |
| 64 |
f_acc_data (void) |
| 65 |
{ |
| 66 |
unsigned int i; |
| 67 |
#pragma acc data |
| 68 |
{ |
| 69 |
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ |
| 70 |
for (i = 0; i < 2; ++i) |
| 71 |
; |
| 72 |
|
| 73 |
#pragma acc data |
| 74 |
{ |
| 75 |
#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ |
| 76 |
for (i = 0; i < 2; ++i) |
| 77 |
; |
| 78 |
} |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
#pragma acc routine |
| 83 |
void |
| 84 |
f_acc_routine (void) |
| 85 |
{ |
| 86 |
#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */ |
| 87 |
; |
| 88 |
} |
| 89 |
|
| 90 |
void |
| 91 |
f (void) |
| 92 |
{ |
| 93 |
int i, v = 0; |
| 94 |
|
| 95 |
#pragma acc loop gang reduction (+:v) /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ |
| 96 |
for (i = 0; i < 10; i++) |
| 97 |
v++; |
| 98 |
} |