| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-gimple" } */ |
| 3 |
|
| 4 |
int f (int a, void *b, float c[2]); |
| 5 |
|
| 6 |
#pragma omp declare variant (f) match (construct={dispatch}) adjust_args (nothing: a) adjust_args (need_device_ptr: b, c) |
| 7 |
int f0 (int a, void *b, float c[2]); |
| 8 |
#pragma omp declare variant (f) adjust_args (need_device_ptr: b, c) match (construct={dispatch}) adjust_args (nothing: a) |
| 9 |
int f1 (int a, void *b, float c[2]); |
| 10 |
|
| 11 |
void test () { |
| 12 |
int a; |
| 13 |
void *b; |
| 14 |
float c[2]; |
| 15 |
|
| 16 |
#pragma omp dispatch |
| 17 |
f0 (a, b, c); |
| 18 |
|
| 19 |
#pragma omp dispatch device (-4852) |
| 20 |
f0 (a, b, c); |
| 21 |
|
| 22 |
#pragma omp dispatch device (a + a) |
| 23 |
f0 (a, b, c); |
| 24 |
} |
| 25 |
|
| 26 |
/* { dg-final { scan-tree-dump-times "__builtin_omp_get_default_device \\(\\);" 3 "gimple" } } */ |
| 27 |
/* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(&c, D\.\[0-9]+\\);" 2 "gimple" } } */ |
| 28 |
/* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(b, D\.\[0-9]+\\);" 2 "gimple" } } */ |
| 29 |
/* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(&c, -4852\\);" 1 "gimple" } } */ |
| 30 |
/* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(b, -4852\\);" 1 "gimple" } } */ |
| 31 |
/* { dg-final { scan-tree-dump-not "#pragma omp dispatch device" "gimple" } } */ |