Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/gomp/declare-variant-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 int foo (int, int, int *); | |
2 int bar (int, int, int *); | |
3 #pragma omp declare variant (foo) \ | |
4 match (construct={parallel,for},\ | |
5 device={isa(avx512f,avx512vl),kind(host,cpu)},\ | |
6 implementation={vendor(score(0):gnu),unified_shared_memory},\ | |
7 user={condition(score(0):0)}) | |
8 #pragma omp declare variant (bar) \ | |
9 match (device={arch(x86_64,powerpc64),isa(avx512f,popcntb)}, \ | |
10 implementation={atomic_default_mem_order(seq_cst),made_up_selector("foo", 13, "bar")}, \ | |
11 user={condition(3-3)}) | |
12 int baz (int, int, int *); | |
13 | |
14 int | |
15 qux (void) | |
16 { | |
17 int i = 3; | |
18 return baz (1, 2, &i); | |
19 } | |
20 | |
21 int quux (int); | |
22 | |
23 void | |
24 corge (void) | |
25 { | |
26 int i; | |
27 #pragma omp declare variant (quux) match (construct={parallel,for}) | |
28 extern int waldo (int); | |
29 waldo (5); | |
30 #pragma omp parallel for | |
31 for (i = 0; i < 3; i++) | |
32 waldo (6); | |
33 #pragma omp parallel | |
34 #pragma omp taskgroup | |
35 #pragma omp for | |
36 for (i = 0; i < 3; i++) | |
37 waldo (7); | |
38 #pragma omp parallel | |
39 #pragma omp master | |
40 waldo (8); | |
41 } | |
42 | |
43 #pragma omp declare variant (bar) match \ | |
44 (implementation={atomic_default_mem_order(relaxed), \ | |
45 unified_address, unified_shared_memory, \ | |
46 dynamic_allocators, reverse_offload}) | |
47 int baz2 (int x, int y, int *z) | |
48 { | |
49 return x + y + *z; | |
50 } | |
51 | |
52 #pragma omp declare variant (bar) match \ | |
53 (implementation={atomic_default_mem_order(score(3): acq_rel)}) | |
54 int baz3 (int, int, int *); |