| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-foffload=disable -fdump-tree-gimple" } */ |
| 3 |
/* { dg-additional-options "-mavx512bw -mavx512vl" { target { i?86-*-* x86_64-*-* } } } */ |
| 4 |
|
| 5 |
#pragma omp requires atomic_default_mem_order(seq_cst) |
| 6 |
void f01 (void); |
| 7 |
void f02 (void); |
| 8 |
void f03 (void); |
| 9 |
#pragma omp declare variant (f01) match (device={isa("avx512f","avx512vl")}) /* 16 */ |
| 10 |
#pragma omp declare variant (f02) match (implementation={vendor(score(15):gnu)}) |
| 11 |
#pragma omp declare variant (f03) match (user={condition(score(11):1)}) |
| 12 |
void f04 (void); |
| 13 |
void f05 (void); |
| 14 |
void f06 (void); |
| 15 |
void f07 (void); |
| 16 |
#pragma omp declare variant (f05) match (device={isa(avx512f,avx512vl)}) /* 16 */ |
| 17 |
#pragma omp declare variant (f06) match (implementation={vendor(score(15):gnu)}) |
| 18 |
#pragma omp declare variant (f07) match (user={condition(score(17):1)}) |
| 19 |
void f08 (void); |
| 20 |
void f09 (void); |
| 21 |
void f10 (void); |
| 22 |
void f11 (void); |
| 23 |
void f12 (void); |
| 24 |
#pragma omp declare variant (f09) match (device={arch(x86_64)},user={condition(score(65):1)}) /* 64+65 */ |
| 25 |
#pragma omp declare variant (f10) match (implementation={vendor(score(127):"gnu")}) |
| 26 |
#pragma omp declare variant (f11) match (device={isa(ssse3)}) /* 128 */ |
| 27 |
#pragma omp declare variant (f12) match (implementation={atomic_default_mem_order(score(126):seq_cst)}) |
| 28 |
void f13 (void); |
| 29 |
void f14 (void); |
| 30 |
void f15 (void); |
| 31 |
void f16 (void); |
| 32 |
#pragma omp declare variant (f14) match (construct={teams,parallel,for}) /* 1+8+16 */ |
| 33 |
#pragma omp declare variant (f15) match (construct={parallel},user={condition(score(16):1)}) /* 8+16 */ |
| 34 |
#pragma omp declare variant (f16) match (implementation={atomic_default_mem_order(score(24):seq_cst)}) |
| 35 |
void f17 (void); |
| 36 |
void f18 (void); |
| 37 |
void f19 (void); |
| 38 |
void f20 (void); |
| 39 |
#pragma omp declare variant (f18) match (construct={teams,parallel,for}) /* 1+8+6 */ |
| 40 |
#pragma omp declare variant (f19) match (construct={for},user={condition(score(25):1)}) /* 4+25 */ |
| 41 |
#pragma omp declare variant (f20) match (implementation={atomic_default_mem_order(score(28):seq_cst)}) |
| 42 |
void f21 (void); |
| 43 |
void f22 (void); |
| 44 |
void f23 (void); |
| 45 |
void f24 (void); |
| 46 |
#pragma omp declare variant (f22) match (construct={parallel,for}) /* 8+16 */ |
| 47 |
#pragma omp declare variant (f23) match (construct={for}) /* 0 */ |
| 48 |
#pragma omp declare variant (f24) match (implementation={atomic_default_mem_order(score(2):seq_cst)}) |
| 49 |
void f25 (void); |
| 50 |
void f26 (void); |
| 51 |
void f27 (void); |
| 52 |
void f28 (void); |
| 53 |
#pragma omp declare variant (f26) match (construct={parallel,for}) /* 8+16 */ |
| 54 |
#pragma omp declare variant (f27) match (construct={for},user={condition(score(25):1)}) /* 16 + 25 */ |
| 55 |
#pragma omp declare variant (f28) match (implementation={atomic_default_mem_order(score(3):seq_cst)}) |
| 56 |
void f29 (void); |
| 57 |
|
| 58 |
void |
| 59 |
test1 (void) |
| 60 |
{ |
| 61 |
int i, j; |
| 62 |
#pragma omp parallel for /* 2 constructs in OpenMP context, isa has score 2^4. */ |
| 63 |
for (i = 0; i < 1; i++) |
| 64 |
f04 (); /* { dg-final { scan-tree-dump-times "f01 \\\(\\\);" 1 "gimple" { target i?86-*-* x86_64-*-* } } } */ |
| 65 |
/* { dg-final { scan-tree-dump-times "f02 \\\(\\\);" 1 "gimple" { target { ! { i?86-*-* x86_64-*-* } } } } } */ |
| 66 |
#pragma omp target teams /* 2 constructs in OpenMP context, isa has score 2^4. */ |
| 67 |
f08 (); /* { dg-final { scan-tree-dump-times "f07 \\\(\\\);" 1 "gimple" } } */ |
| 68 |
#pragma omp teams |
| 69 |
#pragma omp parallel for |
| 70 |
for (i = 0; i < 1; i++) |
| 71 |
#pragma omp parallel for /* 5 constructs in OpenMP context, arch is 2^6, isa 2^7. */ |
| 72 |
for (j = 0; j < 1; j++) |
| 73 |
{ |
| 74 |
f13 (); /* { dg-final { scan-tree-dump-times "f09 \\\(\\\);" 1 "gimple" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ |
| 75 |
/* { dg-final { scan-tree-dump-times "f11 \\\(\\\);" 1 "gimple" { target { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } */ |
| 76 |
/* { dg-final { scan-tree-dump-times "f10 \\\(\\\);" 1 "gimple" { target { ! { i?86-*-* x86_64-*-* } } } } } */ |
| 77 |
f17 (); /* { dg-final { scan-tree-dump-times "f14 \\\(\\\);" 1 "gimple" } } */ |
| 78 |
f21 (); /* { dg-final { scan-tree-dump-times "f19 \\\(\\\);" 1 "gimple" } } */ |
| 79 |
} |
| 80 |
#pragma omp for |
| 81 |
for (i = 0; i < 1; i++) |
| 82 |
#pragma omp parallel for |
| 83 |
for (j = 0; j < 1; j++) |
| 84 |
{ |
| 85 |
f25 (); /* { dg-final { scan-tree-dump-times "f22 \\\(\\\);" 1 "gimple" } } */ |
| 86 |
f29 (); /* { dg-final { scan-tree-dump-times "f27 \\\(\\\);" 1 "gimple" } } */ |
| 87 |
} |
| 88 |
} |