| 1 |
#if __cplusplus >= 201103L |
| 2 |
# define __GOMP_UINTPTR_T_ENUM : __UINTPTR_TYPE__ |
| 3 |
#else |
| 4 |
# define __GOMP_UINTPTR_T_ENUM |
| 5 |
#endif |
| 6 |
|
| 7 |
typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM |
| 8 |
{ |
| 9 |
omp_interop_none = 0, |
| 10 |
__omp_interop_t_max__ = __UINTPTR_MAX__ |
| 11 |
} omp_interop_t; |
| 12 |
|
| 13 |
void f1(omp_interop_t *) { } |
| 14 |
/* { dg-error "argument 1 of 'f1' must be of 'omp_interop_t'" "" { target c } .-1 } */ |
| 15 |
/* { dg-note "initializing argument 1 of 'void f1\\(omp_interop_t\\*\\)'" "" { target c++ } .-2 } */ |
| 16 |
#pragma omp declare variant(f1) match(construct={dispatch}) \ |
| 17 |
append_args(interop(targetsync, prefer_type({attr("ompx_fun")}))) |
| 18 |
void g1(void); |
| 19 |
/* { dg-note "'append_args' specified here" "" { target c } .-2 } */ |
| 20 |
/* { dg-error "cannot convert 'omp_interop_t' to 'omp_interop_t\\*'" "" { target c++ } .-4 } */ |
| 21 |
|
| 22 |
int f2(omp_interop_t); |
| 23 |
#pragma omp declare variant(f2) \ |
| 24 |
append_args(interop(targetsync, prefer_type("cuda"))) \ |
| 25 |
match(construct={dispatch}) |
| 26 |
int g2(void) { return 5; } |
| 27 |
|
| 28 |
int foo (omp_interop_t *obj1) |
| 29 |
{ |
| 30 |
int res; |
| 31 |
|
| 32 |
#pragma omp dispatch interop(obj1) device(11) /* { dg-error "'obj1' must be of 'omp_interop_t'" } */ |
| 33 |
res = g2(); |
| 34 |
return res; |
| 35 |
} |