| 1 |
/* Test that omp parallel simd schedule uses the correct max_vf for the |
| 2 |
host system, when no target directives are present. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-fopenmp -O2 -fdump-tree-ompexp" } */ |
| 6 |
|
| 7 |
/* Fix a max_vf size so we can scan for it. |
| 8 |
{ dg-additional-options "-msse2 -mno-avx" { target { x86_64-*-* i?86-*-* } } } */ |
| 9 |
|
| 10 |
#define N 1024 |
| 11 |
int a[N], b[N], c[N]; |
| 12 |
|
| 13 |
void |
| 14 |
f2 (void) |
| 15 |
{ |
| 16 |
int i; |
| 17 |
#pragma omp parallel for simd schedule (simd: static, 7) |
| 18 |
for (i = 0; i < N; i++) |
| 19 |
a[i] = b[i] + c[i]; |
| 20 |
} |
| 21 |
|
| 22 |
/* Make sure the max_vf is inlined as a number. |
| 23 |
Hopefully there are no unrelated uses of these numbers ... |
| 24 |
{ dg-final { scan-tree-dump-times {\* 16} 2 "ompexp" { target { x86_64-*-* } } } } |
| 25 |
{ dg-final { scan-tree-dump-times {\+ 16} 1 "ompexp" { target { x86_64-*-* } } } } */ |
| 26 |
|
| 27 |
void |
| 28 |
f3 (int *a, int *b, int *c) |
| 29 |
{ |
| 30 |
int i; |
| 31 |
#pragma omp parallel for simd schedule (simd : dynamic, 7) |
| 32 |
for (i = 0; i < N; i++) |
| 33 |
a[i] = b[i] + c[i]; |
| 34 |
} |
| 35 |
|
| 36 |
/* Make sure the max_vf is inlined as a number. |
| 37 |
{ dg-final { scan-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 16, 0\);} 1 "ompexp" { target { x86_64-*-* } } } } */ |