Compare commits
565
Commits
release_35
...
release_50
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29b515e1e6 | ||
|
|
4ef23db17c | ||
|
|
37c72127e9 | ||
|
|
11cf126119 | ||
|
|
470366641d | ||
|
|
08f2b9ce14 | ||
|
|
67512bb555 | ||
|
|
6999fe680a | ||
|
|
1333cd34fa | ||
|
|
8072ba12e0 | ||
|
|
4efa4a63cf | ||
|
|
a07d8b0a66 | ||
|
|
92f7b797ee | ||
|
|
4c2424f72c | ||
|
|
dd87e37353 | ||
|
|
3b5852c6a1 | ||
|
|
b88a01f4ef | ||
|
|
53e0c92a88 | ||
|
|
4d238bda09 | ||
|
|
0a8f95d15f | ||
|
|
06426cf363 | ||
|
|
597a305494 | ||
|
|
3c37ab915c | ||
|
|
1c31fdada0 | ||
|
|
5e8afb8077 | ||
|
|
6943fc62c3 | ||
|
|
862483e622 | ||
|
|
8924d7386a | ||
|
|
a8b80af9fc | ||
|
|
4bdc9afa72 | ||
|
|
84e84f8bb4 | ||
|
|
2b5580f57b | ||
|
|
d2cb509fa4 | ||
|
|
20fe9e7270 | ||
|
|
fcec73a508 | ||
|
|
e60f480d75 | ||
|
|
50a02e790e | ||
|
|
e4c0f2b8d3 | ||
|
|
c2f4638c23 | ||
|
|
ac4f9700a7 | ||
|
|
e703e783e7 | ||
|
|
07c5582c3b | ||
|
|
1a189314bd | ||
|
|
81a7c91728 | ||
|
|
23f1ee8d87 | ||
|
|
079ec52a07 | ||
|
|
1eb73292d2 | ||
|
|
305e440c56 | ||
|
|
f07924fd3f | ||
|
|
ef71bbcce4 | ||
|
|
9a49cce023 | ||
|
|
fa50db79c4 | ||
|
|
b8b75f9476 | ||
|
|
c75321c16f | ||
|
|
e3e3d228fe | ||
|
|
ea09034b77 | ||
|
|
b78659393e | ||
|
|
3a5a5198c0 | ||
|
|
c5cb0abc91 | ||
|
|
1c2799754b | ||
|
|
c79f0d5955 | ||
|
|
e70eb2bba4 | ||
|
|
17fe17487c | ||
|
|
6168925936 | ||
|
|
d2a2afc3d4 | ||
|
|
96b04de80a | ||
|
|
b61de7c64a | ||
|
|
bff1acca47 | ||
|
|
d3acdf9c86 | ||
|
|
14e93081b9 | ||
|
|
fb0f861623 | ||
|
|
c80d301009 | ||
|
|
7bd7063524 | ||
|
|
b2806f6cc0 | ||
|
|
9c1e6c9bc1 | ||
|
|
0f00053d19 | ||
|
|
8f2e239462 | ||
|
|
c40fa62243 | ||
|
|
1aaa414753 | ||
|
|
4726583580 | ||
|
|
f26c30f014 | ||
|
|
cb9c397660 | ||
|
|
273c4bfef1 | ||
|
|
cf09abbf86 | ||
|
|
6009b4051a | ||
|
|
b00226fdf5 | ||
|
|
bd223d612d | ||
|
|
7ec028b27e | ||
|
|
78b78d175a | ||
|
|
c0cfee9024 | ||
|
|
1dc2e70de2 | ||
|
|
7680cbb63a | ||
|
|
3585ec7dbc | ||
|
|
fa45385094 | ||
|
|
0e5d1992ca | ||
|
|
0c93c1078c | ||
|
|
5e5eadec29 | ||
|
|
dae8e28bec | ||
|
|
71cbef1629 | ||
|
|
5d3a2991ec | ||
|
|
4277fc10ad | ||
|
|
844de54c9c | ||
|
|
e48c1b6d4c | ||
|
|
070870b8e6 | ||
|
|
0fee15bb8f | ||
|
|
8ba8798f2b | ||
|
|
81094a8e67 | ||
|
|
7ca47d5c84 | ||
|
|
36b1103f95 | ||
|
|
0859e6a24e | ||
|
|
d4da538d3c | ||
|
|
76755788c3 | ||
|
|
3fd0cf124f | ||
|
|
1d64a304ca | ||
|
|
50288ab6b7 | ||
|
|
bbdd8b334b | ||
|
|
ae791ee6a5 | ||
|
|
72db09bb15 | ||
|
|
2591774d31 | ||
|
|
754a33e6a1 | ||
|
|
a92421e813 | ||
|
|
c39d28cd81 | ||
|
|
550c021715 | ||
|
|
4fa7d5e207 | ||
|
|
89e22fb843 | ||
|
|
88b2b1cf48 | ||
|
|
f82ad7797b | ||
|
|
af29aaac46 | ||
|
|
0252c7b871 | ||
|
|
27bfdc4a3c | ||
|
|
8ff412c00e | ||
|
|
d1a75f52fc | ||
|
|
0af08c496b | ||
|
|
c5fa69cd0b | ||
|
|
89ab78e360 | ||
|
|
8e30df72a9 | ||
|
|
f091351474 | ||
|
|
cd7b29a48d | ||
|
|
1b9360b367 | ||
|
|
4890f69035 | ||
|
|
75e689d1a6 | ||
|
|
bf6a88004a | ||
|
|
a24629dfeb | ||
|
|
26eea9efa4 | ||
|
|
0f2e782515 | ||
|
|
dbb582e3a8 | ||
|
|
0cbd31b98f | ||
|
|
3a587a8c43 | ||
|
|
bd0745e696 | ||
|
|
75f264c149 | ||
|
|
18238e42de | ||
|
|
de1011b67f | ||
|
|
5c3fd1d828 | ||
|
|
b5f8854970 | ||
|
|
a86e0bab74 | ||
|
|
d9ae211c7d | ||
|
|
6c90de7aaf | ||
|
|
03a057fa63 | ||
|
|
3558291c37 | ||
|
|
78d420b46a | ||
|
|
0fd38d88a8 | ||
|
|
6dd28bf89f | ||
|
|
17265704ce | ||
|
|
e942708d81 | ||
|
|
643c28a2e4 | ||
|
|
fa6d122132 | ||
|
|
7ff70929d2 | ||
|
|
248f6cc602 | ||
|
|
d72ef36ee0 | ||
|
|
da4548933a | ||
|
|
e570daa772 | ||
|
|
4720bb4a5c | ||
|
|
5afb0c9897 | ||
|
|
f01e27f138 | ||
|
|
1a885988bf | ||
|
|
ad958989b0 | ||
|
|
153bf3fb97 | ||
|
|
d770e3b3e6 | ||
|
|
e402afb408 | ||
|
|
d2f54c3c3b | ||
|
|
5fda24f1d2 | ||
|
|
ab79479bbf | ||
|
|
8d07e31950 | ||
|
|
de40b77396 | ||
|
|
bef163a8b2 | ||
|
|
1860d030e5 | ||
|
|
555cbc14bd | ||
|
|
e82ed9c802 | ||
|
|
c1cd14fc40 | ||
|
|
24cb1f28b4 | ||
|
|
e5a6ff39db | ||
|
|
7ffaa1b0a4 | ||
|
|
5c280a4383 | ||
|
|
5ff54f36e0 | ||
|
|
4cbdcd9d46 | ||
|
|
0951fde96b | ||
|
|
cdab46b74d | ||
|
|
171ddd1f23 | ||
|
|
f7dc7b1746 | ||
|
|
146e0c7b5f | ||
|
|
021a4a2897 | ||
|
|
ed25b3ab12 | ||
|
|
8672b2ed72 | ||
|
|
49c056c6db | ||
|
|
f981e33157 | ||
|
|
6018ddafaa | ||
|
|
56168b3a23 | ||
|
|
93153d271f | ||
|
|
a763c59623 | ||
|
|
8951c8e6f3 | ||
|
|
e75e989062 | ||
|
|
50df1d2f4c | ||
|
|
a93f24d670 | ||
|
|
ce32bac98c | ||
|
|
cbb2a49897 | ||
|
|
541b718def | ||
|
|
100061452c | ||
|
|
5ecfa9d187 | ||
|
|
fea1a1cd1a | ||
|
|
9c04b6d2d7 | ||
|
|
177c3c8777 | ||
|
|
58cc7e0de3 | ||
|
|
531ce2ade7 | ||
|
|
43eef9805e | ||
|
|
561ebb5943 | ||
|
|
f7f0293db9 | ||
|
|
9cab9c8fc5 | ||
|
|
fcef12cd45 | ||
|
|
9c8a7db909 | ||
|
|
b0081632c4 | ||
|
|
aa4e4f26ff | ||
|
|
da1e2c84c3 | ||
|
|
9c0b306f7d | ||
|
|
d19f27349b | ||
|
|
65f68b9d4b | ||
|
|
1238ecb8f7 | ||
|
|
700a1a0f37 | ||
|
|
e0719d4bb6 | ||
|
|
bac3f87342 | ||
|
|
8a3c7df762 | ||
|
|
2f585ea95f | ||
|
|
039c3ab59a | ||
|
|
45c857dc34 | ||
|
|
843428ce2a | ||
|
|
3bef31a43c | ||
|
|
d3e4ccd5d4 | ||
|
|
43ffd46990 | ||
|
|
56dc65916c | ||
|
|
376dc01a45 | ||
|
|
0a8fbe6d06 | ||
|
|
c87f146dfd | ||
|
|
bda570af9c | ||
|
|
3fb06fd2fe | ||
|
|
be019e9440 | ||
|
|
949a018241 | ||
|
|
089e14d905 | ||
|
|
84ea928f38 | ||
|
|
7b70a4f1f5 | ||
|
|
7b93f85cfe | ||
|
|
30f9d73139 | ||
|
|
65298d8318 | ||
|
|
f2e12f4e42 | ||
|
|
71b975dd98 | ||
|
|
3bcc68623b | ||
|
|
014497155a | ||
|
|
0dd34acf87 | ||
|
|
b6ab8f8fd7 | ||
|
|
55582d0683 | ||
|
|
569d1e46d8 | ||
|
|
a83f15dc1f | ||
|
|
cc34ba0458 | ||
|
|
b5e41b49f7 | ||
|
|
53e20db26d | ||
|
|
8d0a576cf4 | ||
|
|
4ceed43a1f | ||
|
|
03208f6d91 | ||
|
|
9a5f28cca8 | ||
|
|
85b4f2c9cf | ||
|
|
c0a469edc3 | ||
|
|
d64c3d7995 | ||
|
|
3d4a12f1c0 | ||
|
|
9a94fcde13 | ||
|
|
33b0f4a88e | ||
|
|
ad1775a1cf | ||
|
|
1588c74337 | ||
|
|
0c1f627ac8 | ||
|
|
a5496bff70 | ||
|
|
c62c0fa658 | ||
|
|
4255e2f88d | ||
|
|
373c7b45ae | ||
|
|
e0df9a933b | ||
|
|
662997c02a | ||
|
|
1251a47e34 | ||
|
|
cb7899d667 | ||
|
|
1256a5d50f | ||
|
|
20e20fe91a | ||
|
|
db9f0656a6 | ||
|
|
ccd4e436a1 | ||
|
|
0ccf0552f5 | ||
|
|
09d935a93e | ||
|
|
7ed52f6efa | ||
|
|
38c9e1422e | ||
|
|
0355c11c1d | ||
|
|
5b35c4a417 | ||
|
|
fa6b30f80a | ||
|
|
78e62243f9 | ||
|
|
2db9469c66 | ||
|
|
b035b29274 | ||
|
|
dc8116e660 | ||
|
|
bfffb780fe | ||
|
|
86a6c9071f | ||
|
|
306381bbda | ||
|
|
940dd50273 | ||
|
|
444b0e1c07 | ||
|
|
4f88c88870 | ||
|
|
3d9851ae3c | ||
|
|
a632fb38bb | ||
|
|
c73da114f8 | ||
|
|
da540cd0d0 | ||
|
|
c77957295e | ||
|
|
7209df241a | ||
|
|
0d9b4ce671 | ||
|
|
98c0f1f794 | ||
|
|
ac919e8776 | ||
|
|
ef79bf6744 | ||
|
|
3c0db8d0f0 | ||
|
|
c4efcf656b | ||
|
|
acb7b535be | ||
|
|
93b3e400ad | ||
|
|
ce2fd30954 | ||
|
|
63a38dc75a | ||
|
|
ea87904bc4 | ||
|
|
8d380df97b | ||
|
|
d62fdbdc17 | ||
|
|
c33a75a1ae | ||
|
|
8d8e4657d1 | ||
|
|
271a72612d | ||
|
|
59fd2d5636 | ||
|
|
5fedb90a30 | ||
|
|
22361cf975 | ||
|
|
de99836584 | ||
|
|
e2b86ca4e4 | ||
|
|
0d94178f2d | ||
|
|
18e13ca264 | ||
|
|
21b23ce699 | ||
|
|
6e98151883 | ||
|
|
9543a7dad8 | ||
|
|
5677b5095c | ||
|
|
f15a791e85 | ||
|
|
103648dd39 | ||
|
|
dfa0ba085a | ||
|
|
2332aabedb | ||
|
|
b9e8048db1 | ||
|
|
e73ff632d5 | ||
|
|
7e9ea404f1 | ||
|
|
a4032ada02 | ||
|
|
dfa603c6ec | ||
|
|
73bdc170b5 | ||
|
|
120e5c4db4 | ||
|
|
62e3cf352c | ||
|
|
5e4f900fd0 | ||
|
|
d1e8ef1834 | ||
|
|
eee928503e | ||
|
|
8ec4ec3838 | ||
|
|
2a541f0d91 | ||
|
|
c64cfb2ef1 | ||
|
|
d76e1838f1 | ||
|
|
90185a5f18 | ||
|
|
fd69bc2810 | ||
|
|
89eb36ffe7 | ||
|
|
25344f9ecc | ||
|
|
a2b144ab95 | ||
|
|
b62edcf6b8 | ||
|
|
d18f8d4d8c | ||
|
|
7811d1db7f | ||
|
|
9e321cbfc5 | ||
|
|
2aec68db20 | ||
|
|
61bb8dd178 | ||
|
|
70eac4ffbd | ||
|
|
60a90c830f | ||
|
|
8cd13fe13e | ||
|
|
98bea25703 | ||
|
|
cecce61d1e | ||
|
|
f56794a06c | ||
|
|
05e6b65636 | ||
|
|
9a904471e9 | ||
|
|
5c72f9ce80 | ||
|
|
0401c9a540 | ||
|
|
8aa5b7d146 | ||
|
|
34260e3af7 | ||
|
|
48df373982 | ||
|
|
0b3c56d5b5 | ||
|
|
ccc39aacca | ||
|
|
e78ed18a55 | ||
|
|
fb9db4c128 | ||
|
|
349425018c | ||
|
|
f8089721ae | ||
|
|
a774451283 | ||
|
|
b6c63f3ee3 | ||
|
|
45318d1e6f | ||
|
|
ac4964ceea | ||
|
|
1960f887c7 | ||
|
|
d78ef70561 | ||
|
|
9c8205e43f | ||
|
|
0e47cdd237 | ||
|
|
1887f0f2ed | ||
|
|
c3e1a461e2 | ||
|
|
fc660a2d58 | ||
|
|
fc8ef92585 | ||
|
|
a5220977d0 | ||
|
|
aab4548382 | ||
|
|
6a56f9430c | ||
|
|
7bd6023443 | ||
|
|
9eca9d092c | ||
|
|
9d7a4861d7 | ||
|
|
d90b41fbda | ||
|
|
2991608ede | ||
|
|
4738131753 | ||
|
|
9a343549b4 | ||
|
|
7edc770912 | ||
|
|
416a19a376 | ||
|
|
a02bbb9b3a | ||
|
|
50be853810 | ||
|
|
d907054da3 | ||
|
|
9b32683178 | ||
|
|
b2e5aba353 | ||
|
|
9d41ae24e1 | ||
|
|
81551056dc | ||
|
|
0ce89f8efe | ||
|
|
b6f9ab4d7c | ||
|
|
39454f4614 | ||
|
|
dc3324f7ee | ||
|
|
7f88ff4ca8 | ||
|
|
c0d8cfddb6 | ||
|
|
219c0242d9 | ||
|
|
bb405b54c6 | ||
|
|
ffef79f8a4 | ||
|
|
0746d6010e | ||
|
|
316fcc308a | ||
|
|
a48c8b78c0 | ||
|
|
295dc6c4f3 | ||
|
|
d4c3a31f48 | ||
|
|
f2cc667b65 | ||
|
|
c4046a0728 | ||
|
|
a409d02503 | ||
|
|
5174723912 | ||
|
|
9015a0bc3e | ||
|
|
4c6ccfea87 | ||
|
|
ce39a6d2ca | ||
|
|
d6fcd063d4 | ||
|
|
a1bf3122c5 | ||
|
|
c6a79237e2 | ||
|
|
1b7b309815 | ||
|
|
5588286861 | ||
|
|
897380cff5 | ||
|
|
ef3f591ff4 | ||
|
|
9c97519f26 | ||
|
|
643e32e86a | ||
|
|
df46ccc9e9 | ||
|
|
3c63973a53 | ||
|
|
8d85f8eca1 | ||
|
|
705074b169 | ||
|
|
d03bb79e0c | ||
|
|
6d330264cc | ||
|
|
5f4fa366ad | ||
|
|
532a5c62ee | ||
|
|
c9239bc64a | ||
|
|
bbb8bf893d | ||
|
|
29ed987b04 | ||
|
|
0b4c1d5ffa | ||
|
|
ae9c8b86e4 | ||
|
|
066dde2994 | ||
|
|
030d077d4b | ||
|
|
336e25ce53 | ||
|
|
6590b366d3 | ||
|
|
b9f584cb60 | ||
|
|
78445f97d8 | ||
|
|
3913441f89 | ||
|
|
97212dc34e | ||
|
|
02f4d88433 | ||
|
|
3a7707192b | ||
|
|
8e7493dbf1 | ||
|
|
be30a9edec | ||
|
|
95876670b8 | ||
|
|
784d89cf28 | ||
|
|
41ab51f237 | ||
|
|
a6bafed791 | ||
|
|
d4f09d3c11 | ||
|
|
1fd47b8943 | ||
|
|
4af0f3a6a7 | ||
|
|
941ff3cfec | ||
|
|
d3bad19554 | ||
|
|
1cbd964ba5 | ||
|
|
efb6bb2106 | ||
|
|
730074da8d | ||
|
|
08a240ddea | ||
|
|
00a59d4327 | ||
|
|
80ba310a1f | ||
|
|
afd2c6c3fd | ||
|
|
98270aa879 | ||
|
|
7866075b26 | ||
|
|
107fb0e39e | ||
|
|
1d0ad7f8a7 | ||
|
|
0c6d80bd14 | ||
|
|
97f7eb4877 | ||
|
|
8c2806cda5 | ||
|
|
1e585c2e08 | ||
|
|
03e9d1a623 | ||
|
|
de7026a553 | ||
|
|
37d0af3296 | ||
|
|
890e8fd276 | ||
|
|
f2d8bd6591 | ||
|
|
24a57ca394 | ||
|
|
20b8da7236 | ||
|
|
8b78c4a5dc | ||
|
|
3fa7333224 | ||
|
|
137f02169d | ||
|
|
1f60457c77 | ||
|
|
f22e087f7c | ||
|
|
893d25d72c | ||
|
|
45ed5c3e63 | ||
|
|
6c8cce6f8b | ||
|
|
b4d5def747 | ||
|
|
53e806cdc1 | ||
|
|
032f90ffc6 | ||
|
|
5356a729f1 | ||
|
|
195acc9c80 | ||
|
|
19b619330a | ||
|
|
0fb8c1581f | ||
|
|
65e9157ebc | ||
|
|
50cba614b0 | ||
|
|
f23bef7fdc | ||
|
|
143c590366 | ||
|
|
2ce31a0c3a | ||
|
|
8afa9cc53a | ||
|
|
d6f9c6363f | ||
|
|
cf569cf54a | ||
|
|
fe92d4cfd7 | ||
|
|
ba07f9b3fe | ||
|
|
0c9c540c0d | ||
|
|
94f826e819 | ||
|
|
9236d9713a | ||
|
|
50e77e281c | ||
|
|
e6f5cf8f18 | ||
|
|
fea0d84adf | ||
|
|
75159bfdee | ||
|
|
7ab6f4b7f9 | ||
|
|
79a76a5520 | ||
|
|
0a2bac028a | ||
|
|
b8903bff6a | ||
|
|
3be2e89b5f | ||
|
|
1ad88fa8d4 | ||
|
|
b67ee8b7ec | ||
|
|
50c666a9bd | ||
|
|
7680d2964f | ||
|
|
9dd2dbbb70 | ||
|
|
cc78b24209 | ||
|
|
889547d589 | ||
|
|
8e3bb6f34d | ||
|
|
f12a6547f0 | ||
|
|
e3de784d57 | ||
|
|
70f731d6bc | ||
|
|
f780f5d995 | ||
|
|
eb0d2c2faa | ||
|
|
8e8c442780 |
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"project_id" : "openmp",
|
||||
"conduit_uri" : "https://reviews.llvm.org/"
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
#==============================================================================#
|
||||
# This file specifies intentionally untracked files that git should ignore.
|
||||
# See: http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
|
||||
#
|
||||
# This file is intentionally different from the output of `git svn show-ignore`,
|
||||
# as most of those are useless.
|
||||
#==============================================================================#
|
||||
|
||||
#==============================================================================#
|
||||
# File extensions to be ignored anywhere in the tree.
|
||||
#==============================================================================#
|
||||
# Temp files created by most text editors.
|
||||
*~
|
||||
# Merge files created by git.
|
||||
*.orig
|
||||
# Byte compiled python modules.
|
||||
*.pyc
|
||||
# vim swap files
|
||||
.*.sw?
|
||||
.sw?
|
||||
#OS X specific files.
|
||||
.DS_store
|
||||
|
||||
#==============================================================================#
|
||||
# Explicit files to ignore (only matches one).
|
||||
#==============================================================================#
|
||||
# Various tag programs
|
||||
tags
|
||||
/TAGS
|
||||
/GPATH
|
||||
/GRTAGS
|
||||
/GSYMS
|
||||
/GTAGS
|
||||
.gitusers
|
||||
|
||||
#==============================================================================#
|
||||
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
|
||||
#==============================================================================#
|
||||
runtime/exports
|
||||
|
||||
# Nested build directory
|
||||
/build
|
||||
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing")
|
||||
|
||||
add_subdirectory(runtime)
|
||||
|
||||
|
||||
# The tests currently don't pass if the generic ELF plugin is built.
|
||||
# TODO: Fix the tests and enable libomptarget by default on supported
|
||||
# architectures and platforms.
|
||||
set(ENABLE_LIBOMPTARGET OFF)
|
||||
# Currently libomptarget cannot be compiled on Windows or MacOS X.
|
||||
# Since the device plugins are only supported on Linux anyway,
|
||||
# there is no point in trying to compile libomptarget on other OSes.
|
||||
if (WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(ENABLE_LIBOMPTARGET OFF)
|
||||
endif()
|
||||
|
||||
option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
|
||||
${ENABLE_LIBOMPTARGET})
|
||||
if (OPENMP_ENABLE_LIBOMPTARGET)
|
||||
add_subdirectory(libomptarget)
|
||||
endif()
|
||||
+19
-2
@@ -8,13 +8,17 @@ beautification by scripts. The fields are: name (N), email (E), web-address
|
||||
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
|
||||
(S).
|
||||
|
||||
N: Carlo Bertolli
|
||||
W: http://ibm.com
|
||||
D: IBM contributor to PowerPC support in CMake files and elsewhere.
|
||||
|
||||
N: Sunita Chandrasekaran
|
||||
D: Contributor to testsuite from OpenUH
|
||||
|
||||
N: Barbara Chapman
|
||||
D: Contributor to testsuite from OpenUH
|
||||
|
||||
N: University of Houston
|
||||
N: University of Houston
|
||||
W: http://web.cs.uh.edu/~openuh/download/
|
||||
D: OpenUH test suite
|
||||
|
||||
@@ -22,9 +26,18 @@ N: Intel Corporation OpenMP runtime team
|
||||
W: http://openmprtl.org
|
||||
D: Created the runtime.
|
||||
|
||||
N: John Mellor-Crummey and other members of the OpenMP Tools Working Group
|
||||
E: johnmc@rice.edu
|
||||
D: OpenMP Tools Interface (OMPT)
|
||||
|
||||
N: Matthias Muller
|
||||
D: Contributor to testsuite from OpenUH
|
||||
|
||||
N: Tal Nevo
|
||||
E: tal@scalemp.com
|
||||
D: ScaleMP contributor to improve runtime performance there.
|
||||
W: http://scalemp.com
|
||||
|
||||
N: Pavel Neytchev
|
||||
D: Contributor to testsuite from OpenUH
|
||||
|
||||
@@ -36,5 +49,9 @@ N: Alp Toker
|
||||
E: alp@nuanti.com
|
||||
D: Making build work for FreeBSD.
|
||||
|
||||
N: Cheng Wang
|
||||
N: Cheng Wang
|
||||
D: Contributor to testsuite from OpenUH
|
||||
|
||||
N: Diego Caballero
|
||||
E: diego.l.caballero@gmail.com
|
||||
D: Fork performance improvements
|
||||
|
||||
+52
-2
@@ -14,7 +14,7 @@ software contained in this directory tree is included below.
|
||||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
Copyright (c) 1997-2013 Intel Corporation
|
||||
Copyright (c) 1997-2016 Intel Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
@@ -51,7 +51,7 @@ SOFTWARE.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Copyright (c) 1997-2013 Intel Corporation
|
||||
Copyright (c) 1997-2016 Intel Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -122,3 +122,53 @@ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
|
||||
==============================================================================
|
||||
|
||||
ARM Limited
|
||||
|
||||
Software Grant License Agreement ("Agreement")
|
||||
|
||||
Except for the license granted herein to you, ARM Limited ("ARM") reserves all
|
||||
right, title, and interest in and to the Software (defined below).
|
||||
|
||||
Definition
|
||||
|
||||
"Software" means the code and documentation as well as any original work of
|
||||
authorship, including any modifications or additions to an existing work, that
|
||||
is intentionally submitted by ARM to llvm.org (http://llvm.org) ("LLVM") for
|
||||
inclusion in, or documentation of, any of the products owned or managed by LLVM
|
||||
(the "Work"). For the purposes of this definition, "submitted" means any form of
|
||||
electronic, verbal, or written communication sent to LLVM or its
|
||||
representatives, including but not limited to communication on electronic
|
||||
mailing lists, source code control systems, and issue tracking systems that are
|
||||
managed by, or on behalf of, LLVM for the purpose of discussing and improving
|
||||
the Work, but excluding communication that is conspicuously marked otherwise.
|
||||
|
||||
1. Grant of Copyright License. Subject to the terms and conditions of this
|
||||
Agreement, ARM hereby grants to you and to recipients of the Software
|
||||
distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable copyright license to reproduce, prepare derivative
|
||||
works of, publicly display, publicly perform, sublicense, and distribute the
|
||||
Software and such derivative works.
|
||||
|
||||
2. Grant of Patent License. Subject to the terms and conditions of this
|
||||
Agreement, ARM hereby grants you and to recipients of the Software
|
||||
distributed by LLVM a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license
|
||||
to make, have made, use, offer to sell, sell, import, and otherwise transfer
|
||||
the Work, where such license applies only to those patent claims licensable
|
||||
by ARM that are necessarily infringed by ARM's Software alone or by
|
||||
combination of the Software with the Work to which such Software was
|
||||
submitted. If any entity institutes patent litigation against ARM or any
|
||||
other entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||
that ARM's Software, or the Work to which ARM has contributed constitutes
|
||||
direct or contributory patent infringement, then any patent licenses granted
|
||||
to that entity under this Agreement for the Software or Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the software is
|
||||
provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
either express or implied, including, without limitation, any warranties or
|
||||
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
=====================================================================
|
||||
How to Build the LLVM* OpenMP* Offloading Runtime Library using CMake
|
||||
=====================================================================
|
||||
|
||||
==== Version of CMake required: v2.8.0 or above ====
|
||||
|
||||
============================================
|
||||
How to call cmake initially, then repeatedly
|
||||
============================================
|
||||
- When calling cmake for the first time, all needed compiler options
|
||||
must be specified on the command line. After this initial call to
|
||||
cmake, the compiler definitions must not be included for further calls
|
||||
to cmake. Other options can be specified on the command line multiple
|
||||
times including all definitions in the Build options section below.
|
||||
- Example of configuring, building, reconfiguring, rebuilding:
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. # Initial configuration
|
||||
$ make
|
||||
...
|
||||
$ make clean
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Debug .. # Second configuration
|
||||
$ make
|
||||
...
|
||||
$ rm -rf *
|
||||
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. # Third configuration
|
||||
$ make
|
||||
- Notice in the example how the compiler definitions are only specified
|
||||
for an empty build directory, but other Build options are used at any time.
|
||||
- The file CMakeCache.txt which is created after the first call to cmake
|
||||
is a configuration file which holds all the values for the Build options.
|
||||
These configuration values can be changed using a text editor to modify
|
||||
CMakeCache.txt as opposed to using definitions on the command line.
|
||||
- To have cmake create a particular type of build generator file simply
|
||||
inlude the -G <Generator name> option:
|
||||
$ cmake -G "Unix Makefiles" ...
|
||||
You can see a list of generators cmake supports by executing cmake with
|
||||
no arguments and a list will be printed.
|
||||
|
||||
=====================
|
||||
Instructions to Build
|
||||
=====================
|
||||
$ cd libomptarget_top_level/ [ directory with plugins/ , deviceRTLs/ , etc. ]
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
|
||||
[ Unix* Libraries ]
|
||||
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> ..
|
||||
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
===========
|
||||
Tests
|
||||
===========
|
||||
After the library has been built, there are optional tests that can be
|
||||
performed. Some will be skipped based upon the platform.
|
||||
To run the tests,
|
||||
$ make check-libomptarget
|
||||
|
||||
=============
|
||||
CMake options
|
||||
=============
|
||||
-DCMAKE_C_COMPILER=<C compiler name>
|
||||
Specify the C compiler
|
||||
|
||||
-DCMAKE_CXX_COMPILER=<C++ compiler name>
|
||||
Specify the C++ compiler
|
||||
|
||||
==== First values listed are the default value ====
|
||||
-DCMAKE_BUILD_TYPE=Release|Debug|RelWithDebInfo
|
||||
Build type can be Release, Debug, or RelWithDebInfo.
|
||||
|
||||
-DLIBOMPTARGET_ENABLE_WERROR=true|false
|
||||
Should consider warnings as errors.
|
||||
|
||||
-DLIBOMPTARGET_LLVM_LIT_EXECUTABLE=""
|
||||
Full path to the llvm-lit tool. Required for testing in out-of-tree builds.
|
||||
|
||||
-DLIBOMPTARGET_FILECHECK_EXECUTABLE=""
|
||||
Full path to the FileCheck tool. Required for testing in out-of-tree builds.
|
||||
|
||||
-DLIBOMPTARGET_OPENMP_HEADER_FOLDER=""
|
||||
Path of the folder that contains omp.h. This is required for testing
|
||||
out-of-tree builds.
|
||||
|
||||
-DLIBOMPTARGET_OPENMP_HOST_RTL_FOLDER=""
|
||||
Path of the folder that contains libomp.so. This is required for testing
|
||||
out-of-tree builds.
|
||||
|
||||
==== NVPTX device RTL specific ====
|
||||
-DLIBOMPTARGET_NVPTX_ENABLE_BCLIB=false|true
|
||||
Enable CUDA LLVM bitcode offloading device RTL. This is used for
|
||||
link time optimization of the omp runtime and application code.
|
||||
|
||||
-DLIBOMPTARGET_NVPTX_CUDA_COMPILER=<CUDA compiler name>
|
||||
Location of a CUDA compiler capable of emitting LLVM bitcode.
|
||||
Currently only the Clang compiler is supported. This is only used
|
||||
when building the CUDA LLVM bitcode offloading device RTL. If
|
||||
unspecified, the default paths are inspected.
|
||||
|
||||
-DLIBOMPTARGET_NVPTX_BC_LINKER=<LLVM bitcode linker>
|
||||
Location of a linker capable of linking LLVM bitcode objects.
|
||||
This is only used when building the CUDA LLVM bitcode offloading
|
||||
device RTL. If unspecified, the default paths are inspected.
|
||||
|
||||
-DLIBOMPTARGET_NVPTX_ALTERNATE_HOST_COMPILER=""
|
||||
Host compiler to use with NVCC. This compiler is not going to be used to produce
|
||||
any binary. Instead, this is used to overcome the input compiler checks done by
|
||||
NVCC. E.g. if using a default host compiler that is not compatible with NVCC,
|
||||
this option can be use to pass to NVCC a valid compiler to avoid the error.
|
||||
|
||||
-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITY="35"
|
||||
Comma-separated list of CUDA compute capabilities that should be supported by
|
||||
the NVPTX device RTL. E.g. for compute capabilities 3.0 and 3.5, the option
|
||||
"30,35" should be used.
|
||||
|
||||
=======================
|
||||
Example usages of CMake
|
||||
=======================
|
||||
---- Typical usage ----
|
||||
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
|
||||
|
||||
---- Request an NVPTX runtime library that supports compute capability 5.0 ----
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITY="50"
|
||||
|
||||
=========
|
||||
Footnotes
|
||||
=========
|
||||
[*] Other names and brands may be claimed as the property of others.
|
||||
@@ -0,0 +1,119 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build offloading library libomptarget.so.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
# CMAKE libomptarget
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
# Add cmake directory to search for custom cmake functions.
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Standalone build or part of LLVM?
|
||||
set(LIBOMPTARGET_STANDALONE_BUILD FALSE)
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR
|
||||
"${CMAKE_SOURCE_DIR}/libomptarget" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
project(libomptarget C CXX)
|
||||
set(LIBOMPTARGET_STANDALONE_BUILD TRUE)
|
||||
endif()
|
||||
|
||||
|
||||
if(${LIBOMPTARGET_STANDALONE_BUILD})
|
||||
set(LIBOMPTARGET_ENABLE_WERROR FALSE CACHE BOOL
|
||||
"Enable -Werror flags to turn warnings into errors for supporting compilers.")
|
||||
# CMAKE_BUILD_TYPE was not defined, set default to Release
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
set(LIBOMPTARGET_LIBDIR_SUFFIX "" CACHE STRING
|
||||
"suffix of lib installation directory, e.g. 64 => lib64")
|
||||
else()
|
||||
set(LIBOMPTARGET_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
|
||||
# If building in tree, we honor the same install suffix LLVM uses.
|
||||
set(LIBOMPTARGET_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})
|
||||
endif()
|
||||
|
||||
# Compiler flag checks.
|
||||
include(config-ix)
|
||||
|
||||
# Message utilities.
|
||||
include(LibomptargetUtils)
|
||||
|
||||
# Get dependencies for the different components of the project.
|
||||
include(LibomptargetGetDependencies)
|
||||
|
||||
# This is a list of all the targets that are supported/tested right now.
|
||||
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu")
|
||||
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} powerpc64le-ibm-linux-gnu")
|
||||
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} powerpc64-ibm-linux-gnu")
|
||||
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} x86_64-pc-linux-gnu")
|
||||
set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} nvptx64-nvidia-cuda")
|
||||
|
||||
# Once the plugins for the different targets are validated, they will be added to
|
||||
# the list of supported targets in the current system.
|
||||
set (LIBOMPTARGET_SYSTEM_TARGETS "")
|
||||
|
||||
# Set base directories - required for lit to locate the tests.
|
||||
set(LIBOMPTARGET_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(LIBOMPTARGET_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# We need C++11 support.
|
||||
if(LIBOMPTARGET_HAVE_STD_CPP11_FLAG)
|
||||
|
||||
libomptarget_say("Building offloading runtime library libomptarget.")
|
||||
|
||||
# Enable support for C++11.
|
||||
add_definitions(-std=c++11)
|
||||
|
||||
if(LIBOMPTARGET_ENABLE_WERROR AND LIBOMPTARGET_HAVE_WERROR_FLAG)
|
||||
add_definitions(-Werror)
|
||||
endif()
|
||||
|
||||
# If building this library in debug mode, we define a macro to enable
|
||||
# dumping progress messages at runtime.
|
||||
string( TOLOWER "${CMAKE_BUILD_TYPE}" LIBOMPTARGET_CMAKE_BUILD_TYPE)
|
||||
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
|
||||
add_definitions(-DOMPTARGET_DEBUG)
|
||||
add_definitions(-g)
|
||||
add_definitions(-O0)
|
||||
endif()
|
||||
|
||||
set(src_files
|
||||
src/omptarget.cpp
|
||||
)
|
||||
|
||||
include_directories(src/)
|
||||
|
||||
# Build libomptarget library with libdl dependency.
|
||||
add_library(omptarget SHARED ${src_files})
|
||||
target_link_libraries(omptarget
|
||||
${CMAKE_DL_LIBS}
|
||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
|
||||
|
||||
# Install libomptarget under the lib destination folder.
|
||||
install(TARGETS omptarget LIBRARY DESTINATION lib${LIBOMPTARGET_LIBDIR_SUFFIX})
|
||||
|
||||
# Retrieve the path to the resulting library so that it can be used for
|
||||
# testing.
|
||||
get_target_property(LIBOMPTARGET_LIBRARY_DIR omptarget LIBRARY_OUTPUT_DIRECTORY)
|
||||
if(NOT LIBOMPTARGET_LIBRARY_DIR)
|
||||
set(LIBOMPTARGET_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
# Build offloading plugins and device RTLs if they are available.
|
||||
add_subdirectory(plugins)
|
||||
|
||||
# Add tests.
|
||||
add_subdirectory(test)
|
||||
|
||||
else(LIBOMPTARGET_HAVE_STD_CPP11_FLAG)
|
||||
libomptarget_say("Not building offloading runtime library libomptarget: host compiler must have c++11 support.")
|
||||
endif(LIBOMPTARGET_HAVE_STD_CPP11_FLAG)
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
README for the LLVM* OpenMP* Offloading Runtime Library (libomptarget)
|
||||
======================================================================
|
||||
|
||||
How to Build the LLVM* OpenMP* Offloading Runtime Library (libomptarget)
|
||||
========================================================================
|
||||
In-tree build:
|
||||
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp (libomptarget lives under ./libomptarget) into llvm/projects
|
||||
$ cd where-you-want-to-build
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/llvm -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make omptarget
|
||||
|
||||
Out-of-tree build:
|
||||
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp (libomptarget lives under ./libomptarget)
|
||||
$ cd where-you-want-to-live/openmp/libomptarget
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/openmp -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make
|
||||
|
||||
For details about building, please look at Build_With_CMake.txt
|
||||
|
||||
Architectures Supported
|
||||
=======================
|
||||
The current library has been only tested in Linux operating system and the
|
||||
following host architectures:
|
||||
* Intel(R) 64 architecture
|
||||
* IBM(R) Power architecture (big endian)
|
||||
* IBM(R) Power architecture (little endian)
|
||||
* ARM(R) AArch64 architecture (little endian)
|
||||
|
||||
The currently supported offloading device architectures are:
|
||||
* Intel(R) 64 architecture (generic 64-bit plugin - mostly for testing purposes)
|
||||
* IBM(R) Power architecture (big endian) (generic 64-bit plugin - mostly for testing purposes)
|
||||
* IBM(R) Power architecture (little endian) (generic 64-bit plugin - mostly for testing purposes)
|
||||
* ARM(R) AArch64 architecture (little endian) (generic 64-bit plugin - mostly for testing purposes)
|
||||
* CUDA(R) enabled 64-bit NVIDIA(R) GPU architectures
|
||||
|
||||
Supported RTL Build Configurations
|
||||
==================================
|
||||
Supported Architectures: Intel(R) 64, IBM(R) Power 7 and Power 8
|
||||
|
||||
---------------------------
|
||||
| gcc | clang |
|
||||
--------------|------------|------------|
|
||||
| Linux* OS | Yes(1) | Yes(2) |
|
||||
-----------------------------------------
|
||||
|
||||
(1) gcc version 4.8.2 or later is supported.
|
||||
(2) clang version 3.7 or later is supported.
|
||||
|
||||
|
||||
Front-end Compilers that work with this RTL
|
||||
===========================================
|
||||
|
||||
The following compilers are known to do compatible code generation for
|
||||
this RTL:
|
||||
- clang (from https://github.com/clang-ykt )
|
||||
- clang (development branch at http://clang.llvm.org - several features still
|
||||
under development)
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Notices
|
||||
=======
|
||||
This library and related compiler support is still under development, so the
|
||||
employed interface is likely to change in the future.
|
||||
|
||||
*Other names and brands may be claimed as the property of others.
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# Try to detect in the system several dependencies required by the different
|
||||
# components of libomptarget. These are the dependencies we have:
|
||||
#
|
||||
# libelf : required by some targets to handle the ELF files at runtime.
|
||||
# libffi : required to launch target kernels given function and argument
|
||||
# pointers.
|
||||
# CUDA : required to control offloading to NVIDIA GPUs.
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
################################################################################
|
||||
# Looking for libelf...
|
||||
################################################################################
|
||||
|
||||
find_path (
|
||||
LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR
|
||||
NAMES
|
||||
libelf.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
ENV CPATH
|
||||
PATH_SUFFIXES
|
||||
libelf)
|
||||
|
||||
find_library (
|
||||
LIBOMPTARGET_DEP_LIBELF_LIBRARIES
|
||||
NAMES
|
||||
elf
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
ENV LIBRARY_PATH
|
||||
ENV LD_LIBRARY_PATH)
|
||||
|
||||
set(LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS ${LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR})
|
||||
find_package_handle_standard_args(
|
||||
LIBOMPTARGET_DEP_LIBELF
|
||||
DEFAULT_MSG
|
||||
LIBOMPTARGET_DEP_LIBELF_LIBRARIES
|
||||
LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(
|
||||
LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS
|
||||
LIBOMPTARGET_DEP_LIBELF_LIBRARIES)
|
||||
|
||||
################################################################################
|
||||
# Looking for libffi...
|
||||
################################################################################
|
||||
find_package(PkgConfig)
|
||||
|
||||
pkg_check_modules(LIBOMPTARGET_SEARCH_LIBFFI QUIET libffi)
|
||||
|
||||
find_path (
|
||||
LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR
|
||||
NAMES
|
||||
ffi.h
|
||||
HINTS
|
||||
${LIBOMPTARGET_SEARCH_LIBFFI_INCLUDEDIR}
|
||||
${LIBOMPTARGET_SEARCH_LIBFFI_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
ENV CPATH)
|
||||
|
||||
# Don't bother look for the library if the header files were not found.
|
||||
if (LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR)
|
||||
find_library (
|
||||
LIBOMPTARGET_DEP_LIBFFI_LIBRARIES
|
||||
NAMES
|
||||
ffi
|
||||
HINTS
|
||||
${LIBOMPTARGET_SEARCH_LIBFFI_LIBDIR}
|
||||
${LIBOMPTARGET_SEARCH_LIBFFI_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
ENV LIBRARY_PATH
|
||||
ENV LD_LIBRARY_PATH)
|
||||
endif()
|
||||
|
||||
set(LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIRS ${LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR})
|
||||
find_package_handle_standard_args(
|
||||
LIBOMPTARGET_DEP_LIBFFI
|
||||
DEFAULT_MSG
|
||||
LIBOMPTARGET_DEP_LIBFFI_LIBRARIES
|
||||
LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(
|
||||
LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIRS
|
||||
LIBOMPTARGET_DEP_LIBFFI_LIBRARIES)
|
||||
|
||||
################################################################################
|
||||
# Looking for CUDA...
|
||||
################################################################################
|
||||
find_package(CUDA QUIET)
|
||||
|
||||
set(LIBOMPTARGET_DEP_CUDA_FOUND ${CUDA_FOUND})
|
||||
set(LIBOMPTARGET_DEP_CUDA_LIBRARIES ${CUDA_LIBRARIES})
|
||||
set(LIBOMPTARGET_DEP_CUDA_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS})
|
||||
|
||||
mark_as_advanced(
|
||||
LIBOMPTARGET_DEP_CUDA_FOUND
|
||||
LIBOMPTARGET_DEP_CUDA_INCLUDE_DIRS
|
||||
LIBOMPTARGET_DEP_CUDA_LIBRARIES)
|
||||
@@ -0,0 +1,28 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# void libomptarget_say(string message_to_user);
|
||||
# - prints out message_to_user
|
||||
macro(libomptarget_say message_to_user)
|
||||
message(STATUS "LIBOMPTARGET: ${message_to_user}")
|
||||
endmacro()
|
||||
|
||||
# void libomptarget_warning_say(string message_to_user);
|
||||
# - prints out message_to_user with a warning
|
||||
macro(libomptarget_warning_say message_to_user)
|
||||
message(WARNING "LIBOMPTARGET: ${message_to_user}")
|
||||
endmacro()
|
||||
|
||||
# void libomptarget_error_say(string message_to_user);
|
||||
# - prints out message_to_user with an error and exits cmake
|
||||
macro(libomptarget_error_say message_to_user)
|
||||
message(FATAL_ERROR "LIBOMPTARGET: ${message_to_user}")
|
||||
endmacro()
|
||||
@@ -9,5 +9,9 @@
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
include tools/linux.inc
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# Checking C, CXX
|
||||
check_cxx_compiler_flag(-std=c++11 LIBOMPTARGET_HAVE_STD_CPP11_FLAG)
|
||||
check_c_compiler_flag(-Werror LIBOMPTARGET_HAVE_WERROR_FLAG)
|
||||
@@ -0,0 +1,28 @@
|
||||
VERS1.0 {
|
||||
global:
|
||||
__tgt_register_lib;
|
||||
__tgt_unregister_lib;
|
||||
__tgt_target_data_begin;
|
||||
__tgt_target_data_end;
|
||||
__tgt_target_data_update;
|
||||
__tgt_target;
|
||||
__tgt_target_teams;
|
||||
__tgt_target_data_begin_nowait;
|
||||
__tgt_target_data_end_nowait;
|
||||
__tgt_target_data_update_nowait;
|
||||
__tgt_target_nowait;
|
||||
__tgt_target_teams_nowait;
|
||||
omp_get_num_devices;
|
||||
omp_get_initial_device;
|
||||
omp_target_alloc;
|
||||
omp_target_free;
|
||||
omp_target_is_present;
|
||||
omp_target_memcpy;
|
||||
omp_target_memcpy_rect;
|
||||
omp_target_associate_ptr;
|
||||
omp_target_disassociate_ptr;
|
||||
__kmpc_push_target_tripcount;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build plugins for the user system if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
# void build_generic_elf64(string tmachine, string tmachine_name, string tmachine_libname, string elf_machine_id);
|
||||
# - build a plugin for an ELF based generic 64-bit target based on libffi.
|
||||
# - tmachine: name of the machine processor as used in the cmake build system.
|
||||
# - tmachine_name: name of the machine to be printed with the debug messages.
|
||||
# - tmachine_libname: machine name to be appended to the plugin library name.
|
||||
macro(build_generic_elf64 tmachine tmachine_name tmachine_libname tmachine_triple elf_machine_id)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
|
||||
if(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
if(LIBOMPTARGET_DEP_LIBFFI_FOUND)
|
||||
|
||||
libomptarget_say("Building ${tmachine_name} offloading plugin.")
|
||||
|
||||
include_directories(${LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIR})
|
||||
include_directories(${LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR})
|
||||
|
||||
# Define macro to be used as prefix of the runtime messages for this target.
|
||||
add_definitions("-DTARGET_NAME=${tmachine_name}")
|
||||
|
||||
# Define macro with the ELF ID for this target.
|
||||
add_definitions("-DTARGET_ELF_ID=${elf_machine_id}")
|
||||
|
||||
add_library("omptarget.rtl.${tmachine_libname}" SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../generic-elf-64bit/src/rtl.cpp)
|
||||
|
||||
# Install plugin under the lib destination folder.
|
||||
install(TARGETS "omptarget.rtl.${tmachine_libname}"
|
||||
LIBRARY DESTINATION lib${LIBOMPTARGET_LIBDIR_SUFFIX})
|
||||
|
||||
target_link_libraries(
|
||||
"omptarget.rtl.${tmachine_libname}"
|
||||
${LIBOMPTARGET_DEP_LIBFFI_LIBRARIES}
|
||||
${LIBOMPTARGET_DEP_LIBELF_LIBRARIES}
|
||||
dl
|
||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../exports")
|
||||
|
||||
# Report to the parent scope that we are building a plugin.
|
||||
set(LIBOMPTARGET_SYSTEM_TARGETS
|
||||
"${LIBOMPTARGET_SYSTEM_TARGETS} ${tmachine_triple}" PARENT_SCOPE)
|
||||
|
||||
else(LIBOMPTARGET_DEP_LIBFFI_FOUND)
|
||||
libomptarget_say("Not building ${tmachine_name} offloading plugin: libffi dependency not found.")
|
||||
endif(LIBOMPTARGET_DEP_LIBFFI_FOUND)
|
||||
else(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
libomptarget_say("Not building ${tmachine_name} offloading plugin: libelf dependency not found.")
|
||||
endif(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
else()
|
||||
libomptarget_say("Not building ${tmachine_name} offloading plugin: machine not found in the system.")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
add_subdirectory(aarch64)
|
||||
add_subdirectory(cuda)
|
||||
add_subdirectory(ppc64)
|
||||
add_subdirectory(ppc64le)
|
||||
add_subdirectory(x86_64)
|
||||
|
||||
# Make sure the parent scope can see the plugins that will be created.
|
||||
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}" PARENT_SCOPE)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build a plugin for an aarch64 machine if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
build_generic_elf64("aarch64" "aarch64" "aarch64" "aarch64-unknown-linux-gnu" "183")
|
||||
else()
|
||||
libomptarget_say("Not building aarch64 offloading plugin: machine not found in the system.")
|
||||
endif()
|
||||
@@ -0,0 +1,73 @@
|
||||
//===-- elf_common.c - Common ELF functionality -------------------*- C -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Common ELF functionality for target plugins.
|
||||
// Must be included in the plugin source file AFTER omptarget.h has been
|
||||
// included and macro DP(...) has been defined.
|
||||
// .
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if !(defined(_OMPTARGET_H_) && defined(DP))
|
||||
#error Include elf_common.c in the plugin source AFTER omptarget.h has been\
|
||||
included and macro DP(...) has been defined.
|
||||
#endif
|
||||
|
||||
#include <elf.h>
|
||||
#include <libelf.h>
|
||||
|
||||
// Check whether an image is valid for execution on target_id
|
||||
static inline int32_t elf_check_machine(__tgt_device_image *image,
|
||||
uint16_t target_id) {
|
||||
|
||||
// Is the library version incompatible with the header file?
|
||||
if (elf_version(EV_CURRENT) == EV_NONE) {
|
||||
DP("Incompatible ELF library!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *img_begin = (char *)image->ImageStart;
|
||||
char *img_end = (char *)image->ImageEnd;
|
||||
size_t img_size = img_end - img_begin;
|
||||
|
||||
// Obtain elf handler
|
||||
Elf *e = elf_memory(img_begin, img_size);
|
||||
if (!e) {
|
||||
DP("Unable to get ELF handle: %s!\n", elf_errmsg(-1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Check if ELF is the right kind.
|
||||
if (elf_kind(e) != ELF_K_ELF) {
|
||||
DP("Unexpected ELF type!\n");
|
||||
return 0;
|
||||
}
|
||||
Elf64_Ehdr *eh64 = elf64_getehdr(e);
|
||||
Elf32_Ehdr *eh32 = elf32_getehdr(e);
|
||||
|
||||
if (!eh64 && !eh32) {
|
||||
DP("Unable to get machine ID from ELF file!\n");
|
||||
elf_end(e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t MachineID;
|
||||
if (eh64 && !eh32)
|
||||
MachineID = eh64->e_machine;
|
||||
else if (eh32 && !eh64)
|
||||
MachineID = eh32->e_machine;
|
||||
else {
|
||||
DP("Ambiguous ELF header!\n");
|
||||
elf_end(e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
elf_end(e);
|
||||
return MachineID == target_id;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build a plugin for a CUDA machine if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
if(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
if(LIBOMPTARGET_DEP_CUDA_FOUND)
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)$" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
|
||||
libomptarget_say("Building CUDA offloading plugin.")
|
||||
|
||||
# Define the suffix for the runtime messaging dumps.
|
||||
add_definitions(-DTARGET_NAME=CUDA)
|
||||
|
||||
if(LIBOMPTARGET_CMAKE_BUILD_TYPE MATCHES debug)
|
||||
add_definitions(-DCUDA_ERROR_REPORT)
|
||||
endif()
|
||||
|
||||
include_directories(${LIBOMPTARGET_DEP_CUDA_INCLUDE_DIRS})
|
||||
include_directories(${LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS})
|
||||
|
||||
add_library(omptarget.rtl.cuda SHARED src/rtl.cpp)
|
||||
|
||||
# Install plugin under the lib destination folder.
|
||||
install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION lib${LIBOMPTARGET_LIBDIR_SUFFIX})
|
||||
|
||||
target_link_libraries(omptarget.rtl.cuda
|
||||
${LIBOMPTARGET_DEP_CUDA_LIBRARIES}
|
||||
cuda
|
||||
${LIBOMPTARGET_DEP_LIBELF_LIBRARIES}
|
||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../exports")
|
||||
|
||||
# Report to the parent scope that we are building a plugin for CUDA.
|
||||
set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda" PARENT_SCOPE)
|
||||
else()
|
||||
libomptarget_say("Not building CUDA offloading plugin: only support CUDA in Linux x86_64 or ppc64le hosts.")
|
||||
endif()
|
||||
else()
|
||||
libomptarget_say("Not building CUDA offloading plugin: CUDA not found in system.")
|
||||
endif()
|
||||
else(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
libomptarget_say("Not building CUDA offloading plugin: libelf dependency not found.")
|
||||
endif(LIBOMPTARGET_DEP_LIBELF_FOUND)
|
||||
@@ -0,0 +1,694 @@
|
||||
//===----RTLs/cuda/src/rtl.cpp - Target RTLs Implementation ------- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// RTL for CUDA machine
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cuda.h>
|
||||
#include <cuda_runtime_api.h>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "omptargetplugin.h"
|
||||
|
||||
#ifndef TARGET_NAME
|
||||
#define TARGET_NAME CUDA
|
||||
#endif
|
||||
|
||||
#define GETNAME2(name) #name
|
||||
#define GETNAME(name) GETNAME2(name)
|
||||
#define DP(...) DEBUGP("Target " GETNAME(TARGET_NAME) " RTL", __VA_ARGS__)
|
||||
|
||||
#include "../../common/elf_common.c"
|
||||
|
||||
// Utility for retrieving and printing CUDA error string.
|
||||
#ifdef CUDA_ERROR_REPORT
|
||||
#define CUDA_ERR_STRING(err) \
|
||||
do { \
|
||||
const char *errStr; \
|
||||
cuGetErrorString(err, &errStr); \
|
||||
DP("CUDA error is: %s\n", errStr); \
|
||||
} while (0)
|
||||
#else
|
||||
#define CUDA_ERR_STRING(err) \
|
||||
{}
|
||||
#endif
|
||||
|
||||
/// Keep entries table per device.
|
||||
struct FuncOrGblEntryTy {
|
||||
__tgt_target_table Table;
|
||||
std::vector<__tgt_offload_entry> Entries;
|
||||
};
|
||||
|
||||
enum ExecutionModeType {
|
||||
SPMD, // constructors, destructors,
|
||||
// combined constructs (`teams distribute parallel for [simd]`)
|
||||
GENERIC, // everything else
|
||||
NONE
|
||||
};
|
||||
|
||||
/// Use a single entity to encode a kernel and a set of flags
|
||||
struct KernelTy {
|
||||
CUfunction Func;
|
||||
|
||||
// execution mode of kernel
|
||||
// 0 - SPMD mode (without master warp)
|
||||
// 1 - Generic mode (with master warp)
|
||||
int8_t ExecutionMode;
|
||||
|
||||
KernelTy(CUfunction _Func, int8_t _ExecutionMode)
|
||||
: Func(_Func), ExecutionMode(_ExecutionMode) {}
|
||||
};
|
||||
|
||||
/// List that contains all the kernels.
|
||||
/// FIXME: we may need this to be per device and per library.
|
||||
std::list<KernelTy> KernelsList;
|
||||
|
||||
/// Class containing all the device information.
|
||||
class RTLDeviceInfoTy {
|
||||
std::vector<FuncOrGblEntryTy> FuncGblEntries;
|
||||
|
||||
public:
|
||||
int NumberOfDevices;
|
||||
std::vector<CUmodule> Modules;
|
||||
std::vector<CUcontext> Contexts;
|
||||
|
||||
// Device properties
|
||||
std::vector<int> ThreadsPerBlock;
|
||||
std::vector<int> BlocksPerGrid;
|
||||
std::vector<int> WarpSize;
|
||||
|
||||
// OpenMP properties
|
||||
std::vector<int> NumTeams;
|
||||
std::vector<int> NumThreads;
|
||||
|
||||
// OpenMP Environment properties
|
||||
int EnvNumTeams;
|
||||
int EnvTeamLimit;
|
||||
|
||||
//static int EnvNumThreads;
|
||||
static const int HardTeamLimit = 1<<16; // 64k
|
||||
static const int HardThreadLimit = 1024;
|
||||
static const int DefaultNumTeams = 128;
|
||||
static const int DefaultNumThreads = 128;
|
||||
|
||||
// Record entry point associated with device
|
||||
void addOffloadEntry(int32_t device_id, __tgt_offload_entry entry) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
E.Entries.push_back(entry);
|
||||
}
|
||||
|
||||
// Return true if the entry is associated with device
|
||||
bool findOffloadEntry(int32_t device_id, void *addr) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
for (auto &it : E.Entries) {
|
||||
if (it.addr == addr)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return the pointer to the target entries table
|
||||
__tgt_target_table *getOffloadEntriesTable(int32_t device_id) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
int32_t size = E.Entries.size();
|
||||
|
||||
// Table is empty
|
||||
if (!size)
|
||||
return 0;
|
||||
|
||||
__tgt_offload_entry *begin = &E.Entries[0];
|
||||
__tgt_offload_entry *end = &E.Entries[size - 1];
|
||||
|
||||
// Update table info according to the entries and return the pointer
|
||||
E.Table.EntriesBegin = begin;
|
||||
E.Table.EntriesEnd = ++end;
|
||||
|
||||
return &E.Table;
|
||||
}
|
||||
|
||||
// Clear entries table for a device
|
||||
void clearOffloadEntriesTable(int32_t device_id) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
E.Entries.clear();
|
||||
E.Table.EntriesBegin = E.Table.EntriesEnd = 0;
|
||||
}
|
||||
|
||||
RTLDeviceInfoTy() {
|
||||
DP("Start initializing CUDA\n");
|
||||
|
||||
CUresult err = cuInit(0);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when initializing CUDA\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return;
|
||||
}
|
||||
|
||||
NumberOfDevices = 0;
|
||||
|
||||
err = cuDeviceGetCount(&NumberOfDevices);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when getting CUDA device count\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (NumberOfDevices == 0) {
|
||||
DP("There are no devices supporting CUDA.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
FuncGblEntries.resize(NumberOfDevices);
|
||||
Contexts.resize(NumberOfDevices);
|
||||
ThreadsPerBlock.resize(NumberOfDevices);
|
||||
BlocksPerGrid.resize(NumberOfDevices);
|
||||
WarpSize.resize(NumberOfDevices);
|
||||
NumTeams.resize(NumberOfDevices);
|
||||
NumThreads.resize(NumberOfDevices);
|
||||
|
||||
// Get environment variables regarding teams
|
||||
char *envStr = getenv("OMP_TEAM_LIMIT");
|
||||
if (envStr) {
|
||||
// OMP_TEAM_LIMIT has been set
|
||||
EnvTeamLimit = std::stoi(envStr);
|
||||
DP("Parsed OMP_TEAM_LIMIT=%d\n", EnvTeamLimit);
|
||||
} else {
|
||||
EnvTeamLimit = -1;
|
||||
}
|
||||
envStr = getenv("OMP_NUM_TEAMS");
|
||||
if (envStr) {
|
||||
// OMP_NUM_TEAMS has been set
|
||||
EnvNumTeams = std::stoi(envStr);
|
||||
DP("Parsed OMP_NUM_TEAMS=%d\n", EnvNumTeams);
|
||||
} else {
|
||||
EnvNumTeams = -1;
|
||||
}
|
||||
}
|
||||
|
||||
~RTLDeviceInfoTy() {
|
||||
// Close modules
|
||||
for (auto &module : Modules)
|
||||
if (module) {
|
||||
CUresult err = cuModuleUnload(module);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when unloading CUDA module\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy contexts
|
||||
for (auto &ctx : Contexts)
|
||||
if (ctx) {
|
||||
CUresult err = cuCtxDestroy(ctx);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when destroying CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static RTLDeviceInfoTy DeviceInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *image) {
|
||||
return elf_check_machine(image, 190); // EM_CUDA = 190.
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_number_of_devices() { return DeviceInfo.NumberOfDevices; }
|
||||
|
||||
int32_t __tgt_rtl_init_device(int32_t device_id) {
|
||||
|
||||
CUdevice cuDevice;
|
||||
DP("Getting device %d\n", device_id);
|
||||
CUresult err = cuDeviceGet(&cuDevice, device_id);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when getting CUDA device with id = %d\n", device_id);
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
// Create the context and save it to use whenever this device is selected.
|
||||
err = cuCtxCreate(&DeviceInfo.Contexts[device_id], CU_CTX_SCHED_BLOCKING_SYNC,
|
||||
cuDevice);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when creating a CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
// scan properties to determine number of threads/block and blocks/grid.
|
||||
struct cudaDeviceProp Properties;
|
||||
cudaError_t error = cudaGetDeviceProperties(&Properties, device_id);
|
||||
if (error != cudaSuccess) {
|
||||
DP("Error getting device Properties, use defaults\n");
|
||||
DeviceInfo.BlocksPerGrid[device_id] = RTLDeviceInfoTy::DefaultNumTeams;
|
||||
DeviceInfo.ThreadsPerBlock[device_id] = RTLDeviceInfoTy::DefaultNumThreads;
|
||||
DeviceInfo.WarpSize[device_id] = 32;
|
||||
} else {
|
||||
// Get blocks per grid
|
||||
if (Properties.maxGridSize[0] <= RTLDeviceInfoTy::HardTeamLimit) {
|
||||
DeviceInfo.BlocksPerGrid[device_id] = Properties.maxGridSize[0];
|
||||
DP("Using %d CUDA blocks per grid\n", Properties.maxGridSize[0]);
|
||||
} else {
|
||||
DeviceInfo.BlocksPerGrid[device_id] = RTLDeviceInfoTy::HardTeamLimit;
|
||||
DP("Max CUDA blocks per grid %d exceeds the hard team limit %d, capping "
|
||||
"at the hard limit\n", Properties.maxGridSize[0],
|
||||
RTLDeviceInfoTy::HardTeamLimit);
|
||||
}
|
||||
|
||||
// Get threads per block, exploit threads only along x axis
|
||||
if (Properties.maxThreadsDim[0] <= RTLDeviceInfoTy::HardThreadLimit) {
|
||||
DeviceInfo.ThreadsPerBlock[device_id] = Properties.maxThreadsDim[0];
|
||||
DP("Using %d CUDA threads per block\n", Properties.maxThreadsDim[0]);
|
||||
if (Properties.maxThreadsDim[0] < Properties.maxThreadsPerBlock) {
|
||||
DP("(fewer than max per block along all xyz dims %d)\n",
|
||||
Properties.maxThreadsPerBlock);
|
||||
}
|
||||
} else {
|
||||
DeviceInfo.ThreadsPerBlock[device_id] = RTLDeviceInfoTy::HardThreadLimit;
|
||||
DP("Max CUDA threads per block %d exceeds the hard thread limit %d, "
|
||||
"capping at the hard limit\n", Properties.maxThreadsDim[0],
|
||||
RTLDeviceInfoTy::HardThreadLimit);
|
||||
}
|
||||
|
||||
// Get warp size
|
||||
DeviceInfo.WarpSize[device_id] = Properties.warpSize;
|
||||
}
|
||||
|
||||
// Adjust teams to the env variables
|
||||
if (DeviceInfo.EnvTeamLimit > 0 &&
|
||||
DeviceInfo.BlocksPerGrid[device_id] > DeviceInfo.EnvTeamLimit) {
|
||||
DeviceInfo.BlocksPerGrid[device_id] = DeviceInfo.EnvTeamLimit;
|
||||
DP("Capping max CUDA blocks per grid to OMP_TEAM_LIMIT=%d\n",
|
||||
DeviceInfo.EnvTeamLimit);
|
||||
}
|
||||
|
||||
DP("Max number of CUDA blocks %d, threads %d & warp size %d\n",
|
||||
DeviceInfo.BlocksPerGrid[device_id], DeviceInfo.ThreadsPerBlock[device_id],
|
||||
DeviceInfo.WarpSize[device_id]);
|
||||
|
||||
// Set default number of teams
|
||||
if (DeviceInfo.EnvNumTeams > 0) {
|
||||
DeviceInfo.NumTeams[device_id] = DeviceInfo.EnvNumTeams;
|
||||
DP("Default number of teams set according to environment %d\n",
|
||||
DeviceInfo.EnvNumTeams);
|
||||
} else {
|
||||
DeviceInfo.NumTeams[device_id] = RTLDeviceInfoTy::DefaultNumTeams;
|
||||
DP("Default number of teams set according to library's default %d\n",
|
||||
RTLDeviceInfoTy::DefaultNumTeams);
|
||||
}
|
||||
if (DeviceInfo.NumTeams[device_id] > DeviceInfo.BlocksPerGrid[device_id]) {
|
||||
DeviceInfo.NumTeams[device_id] = DeviceInfo.BlocksPerGrid[device_id];
|
||||
DP("Default number of teams exceeds device limit, capping at %d\n",
|
||||
DeviceInfo.BlocksPerGrid[device_id]);
|
||||
}
|
||||
|
||||
// Set default number of threads
|
||||
DeviceInfo.NumThreads[device_id] = RTLDeviceInfoTy::DefaultNumThreads;
|
||||
DP("Default number of threads set according to library's default %d\n",
|
||||
RTLDeviceInfoTy::DefaultNumThreads);
|
||||
if (DeviceInfo.NumThreads[device_id] >
|
||||
DeviceInfo.ThreadsPerBlock[device_id]) {
|
||||
DeviceInfo.NumTeams[device_id] = DeviceInfo.ThreadsPerBlock[device_id];
|
||||
DP("Default number of threads exceeds device limit, capping at %d\n",
|
||||
DeviceInfo.ThreadsPerBlock[device_id]);
|
||||
}
|
||||
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
__tgt_target_table *__tgt_rtl_load_binary(int32_t device_id,
|
||||
__tgt_device_image *image) {
|
||||
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when setting a CUDA context for device %d\n", device_id);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Clear the offload table as we are going to create a new one.
|
||||
DeviceInfo.clearOffloadEntriesTable(device_id);
|
||||
|
||||
// Create the module and extract the function pointers.
|
||||
|
||||
CUmodule cumod;
|
||||
DP("Load data from image " DPxMOD "\n", DPxPTR(image->ImageStart));
|
||||
err = cuModuleLoadDataEx(&cumod, image->ImageStart, 0, NULL, NULL);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when loading CUDA module\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DP("CUDA module successfully loaded!\n");
|
||||
DeviceInfo.Modules.push_back(cumod);
|
||||
|
||||
// Find the symbols in the module by name.
|
||||
__tgt_offload_entry *HostBegin = image->EntriesBegin;
|
||||
__tgt_offload_entry *HostEnd = image->EntriesEnd;
|
||||
|
||||
for (__tgt_offload_entry *e = HostBegin; e != HostEnd; ++e) {
|
||||
|
||||
if (!e->addr) {
|
||||
// We return NULL when something like this happens, the host should have
|
||||
// always something in the address to uniquely identify the target region.
|
||||
DP("Invalid binary: host entry '<null>' (size = %zd)...\n", e->size);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (e->size) {
|
||||
__tgt_offload_entry entry = *e;
|
||||
|
||||
CUdeviceptr cuptr;
|
||||
size_t cusize;
|
||||
err = cuModuleGetGlobal(&cuptr, &cusize, cumod, e->name);
|
||||
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Loading global '%s' (Failed)\n", e->name);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (cusize != e->size) {
|
||||
DP("Loading global '%s' - size mismatch (%zd != %zd)\n", e->name,
|
||||
cusize, e->size);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DP("Entry point " DPxMOD " maps to global %s (" DPxMOD ")\n",
|
||||
DPxPTR(e - HostBegin), e->name, DPxPTR(cuptr));
|
||||
entry.addr = (void *)cuptr;
|
||||
|
||||
DeviceInfo.addOffloadEntry(device_id, entry);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
CUfunction fun;
|
||||
err = cuModuleGetFunction(&fun, cumod, e->name);
|
||||
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Loading '%s' (Failed)\n", e->name);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DP("Entry point " DPxMOD " maps to %s (" DPxMOD ")\n",
|
||||
DPxPTR(e - HostBegin), e->name, DPxPTR(fun));
|
||||
|
||||
// default value GENERIC (in case symbol is missing from cubin file)
|
||||
int8_t ExecModeVal = ExecutionModeType::GENERIC;
|
||||
std::string ExecModeNameStr (e->name);
|
||||
ExecModeNameStr += "_exec_mode";
|
||||
const char *ExecModeName = ExecModeNameStr.c_str();
|
||||
|
||||
CUdeviceptr ExecModePtr;
|
||||
size_t cusize;
|
||||
err = cuModuleGetGlobal(&ExecModePtr, &cusize, cumod, ExecModeName);
|
||||
if (err == CUDA_SUCCESS) {
|
||||
if ((size_t)cusize != sizeof(int8_t)) {
|
||||
DP("Loading global exec_mode '%s' - size mismatch (%zd != %zd)\n",
|
||||
ExecModeName, cusize, sizeof(int8_t));
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err = cuMemcpyDtoH(&ExecModeVal, ExecModePtr, cusize);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when copying data from device to host. Pointers: "
|
||||
"host = " DPxMOD ", device = " DPxMOD ", size = %zd\n",
|
||||
DPxPTR(&ExecModeVal), DPxPTR(ExecModePtr), cusize);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ExecModeVal < 0 || ExecModeVal > 1) {
|
||||
DP("Error wrong exec_mode value specified in cubin file: %d\n",
|
||||
ExecModeVal);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
DP("Loading global exec_mode '%s' - symbol missing, using default value "
|
||||
"GENERIC (1)\n", ExecModeName);
|
||||
CUDA_ERR_STRING(err);
|
||||
}
|
||||
|
||||
KernelsList.push_back(KernelTy(fun, ExecModeVal));
|
||||
|
||||
__tgt_offload_entry entry = *e;
|
||||
entry.addr = (void *)&KernelsList.back();
|
||||
DeviceInfo.addOffloadEntry(device_id, entry);
|
||||
}
|
||||
|
||||
return DeviceInfo.getOffloadEntriesTable(device_id);
|
||||
}
|
||||
|
||||
void *__tgt_rtl_data_alloc(int32_t device_id, int64_t size, void *hst_ptr) {
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error while trying to set CUDA current context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CUdeviceptr ptr;
|
||||
err = cuMemAlloc(&ptr, size);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error while trying to allocate %d\n", err);
|
||||
CUDA_ERR_STRING(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *vptr = (void *)ptr;
|
||||
return vptr;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_submit(int32_t device_id, void *tgt_ptr, void *hst_ptr,
|
||||
int64_t size) {
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when setting CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
err = cuMemcpyHtoD((CUdeviceptr)tgt_ptr, hst_ptr, size);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when copying data from host to device. Pointers: host = " DPxMOD
|
||||
", device = " DPxMOD ", size = %" PRId64 "\n", DPxPTR(hst_ptr),
|
||||
DPxPTR(tgt_ptr), size);
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_retrieve(int32_t device_id, void *hst_ptr, void *tgt_ptr,
|
||||
int64_t size) {
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when setting CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
err = cuMemcpyDtoH(hst_ptr, (CUdeviceptr)tgt_ptr, size);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when copying data from device to host. Pointers: host = " DPxMOD
|
||||
", device = " DPxMOD ", size = %" PRId64 "\n", DPxPTR(hst_ptr),
|
||||
DPxPTR(tgt_ptr), size);
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_delete(int32_t device_id, void *tgt_ptr) {
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when setting CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
err = cuMemFree((CUdeviceptr)tgt_ptr);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when freeing CUDA memory\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr,
|
||||
void **tgt_args, ptrdiff_t *tgt_offsets, int32_t arg_num, int32_t team_num,
|
||||
int32_t thread_limit, uint64_t loop_tripcount) {
|
||||
// Set the context we are using.
|
||||
CUresult err = cuCtxSetCurrent(DeviceInfo.Contexts[device_id]);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Error when setting CUDA context\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
// All args are references.
|
||||
std::vector<void *> args(arg_num);
|
||||
std::vector<void *> ptrs(arg_num);
|
||||
|
||||
for (int32_t i = 0; i < arg_num; ++i) {
|
||||
ptrs[i] = (void *)((intptr_t)tgt_args[i] + tgt_offsets[i]);
|
||||
args[i] = &ptrs[i];
|
||||
}
|
||||
|
||||
KernelTy *KernelInfo = (KernelTy *)tgt_entry_ptr;
|
||||
|
||||
int cudaThreadsPerBlock;
|
||||
|
||||
if (thread_limit > 0) {
|
||||
cudaThreadsPerBlock = thread_limit;
|
||||
DP("Setting CUDA threads per block to requested %d\n", thread_limit);
|
||||
// Add master warp if necessary
|
||||
if (KernelInfo->ExecutionMode == GENERIC) {
|
||||
cudaThreadsPerBlock += DeviceInfo.WarpSize[device_id];
|
||||
DP("Adding master warp: +%d threads\n", DeviceInfo.WarpSize[device_id]);
|
||||
}
|
||||
} else {
|
||||
cudaThreadsPerBlock = DeviceInfo.NumThreads[device_id];
|
||||
DP("Setting CUDA threads per block to default %d\n",
|
||||
DeviceInfo.NumThreads[device_id]);
|
||||
}
|
||||
|
||||
if (cudaThreadsPerBlock > DeviceInfo.ThreadsPerBlock[device_id]) {
|
||||
cudaThreadsPerBlock = DeviceInfo.ThreadsPerBlock[device_id];
|
||||
DP("Threads per block capped at device limit %d\n",
|
||||
DeviceInfo.ThreadsPerBlock[device_id]);
|
||||
}
|
||||
|
||||
int kernel_limit;
|
||||
err = cuFuncGetAttribute(&kernel_limit,
|
||||
CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, KernelInfo->Func);
|
||||
if (err == CUDA_SUCCESS) {
|
||||
if (kernel_limit < cudaThreadsPerBlock) {
|
||||
cudaThreadsPerBlock = kernel_limit;
|
||||
DP("Threads per block capped at kernel limit %d\n", kernel_limit);
|
||||
}
|
||||
}
|
||||
|
||||
int cudaBlocksPerGrid;
|
||||
if (team_num <= 0) {
|
||||
if (loop_tripcount > 0 && DeviceInfo.EnvNumTeams < 0) {
|
||||
if (KernelInfo->ExecutionMode == SPMD) {
|
||||
// We have a combined construct, i.e. `target teams distribute parallel
|
||||
// for [simd]`. We launch so many teams so that each thread will
|
||||
// execute one iteration of the loop.
|
||||
// round up to the nearest integer
|
||||
cudaBlocksPerGrid = ((loop_tripcount - 1) / cudaThreadsPerBlock) + 1;
|
||||
} else {
|
||||
// If we reach this point, then we have a non-combined construct, i.e.
|
||||
// `teams distribute` with a nested `parallel for` and each team is
|
||||
// assigned one iteration of the `distribute` loop. E.g.:
|
||||
//
|
||||
// #pragma omp target teams distribute
|
||||
// for(...loop_tripcount...) {
|
||||
// #pragma omp parallel for
|
||||
// for(...) {}
|
||||
// }
|
||||
//
|
||||
// Threads within a team will execute the iterations of the `parallel`
|
||||
// loop.
|
||||
cudaBlocksPerGrid = loop_tripcount;
|
||||
}
|
||||
DP("Using %d teams due to loop trip count %" PRIu64 " and number of "
|
||||
"threads per block %d\n", cudaBlocksPerGrid, loop_tripcount,
|
||||
cudaThreadsPerBlock);
|
||||
} else {
|
||||
cudaBlocksPerGrid = DeviceInfo.NumTeams[device_id];
|
||||
DP("Using default number of teams %d\n", DeviceInfo.NumTeams[device_id]);
|
||||
}
|
||||
} else if (team_num > DeviceInfo.BlocksPerGrid[device_id]) {
|
||||
cudaBlocksPerGrid = DeviceInfo.BlocksPerGrid[device_id];
|
||||
DP("Capping number of teams to team limit %d\n",
|
||||
DeviceInfo.BlocksPerGrid[device_id]);
|
||||
} else {
|
||||
cudaBlocksPerGrid = team_num;
|
||||
DP("Using requested number of teams %d\n", team_num);
|
||||
}
|
||||
|
||||
// Run on the device.
|
||||
DP("Launch kernel with %d blocks and %d threads\n", cudaBlocksPerGrid,
|
||||
cudaThreadsPerBlock);
|
||||
|
||||
err = cuLaunchKernel(KernelInfo->Func, cudaBlocksPerGrid, 1, 1,
|
||||
cudaThreadsPerBlock, 1, 1, 0 /*bytes of shared memory*/, 0, &args[0], 0);
|
||||
if (err != CUDA_SUCCESS) {
|
||||
DP("Device kernel launch failed!\n");
|
||||
CUDA_ERR_STRING(err);
|
||||
assert(err == CUDA_SUCCESS && "Unable to launch target execution!");
|
||||
return OFFLOAD_FAIL;
|
||||
}
|
||||
|
||||
DP("Launch of entry point at " DPxMOD " successful!\n",
|
||||
DPxPTR(tgt_entry_ptr));
|
||||
|
||||
cudaError_t sync_error = cudaDeviceSynchronize();
|
||||
if (sync_error != cudaSuccess) {
|
||||
DP("Kernel execution error at " DPxMOD ", %s.\n", DPxPTR(tgt_entry_ptr),
|
||||
cudaGetErrorString(sync_error));
|
||||
return OFFLOAD_FAIL;
|
||||
} else {
|
||||
DP("Kernel execution at " DPxMOD " successful!\n", DPxPTR(tgt_entry_ptr));
|
||||
}
|
||||
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_run_target_region(int32_t device_id, void *tgt_entry_ptr,
|
||||
void **tgt_args, ptrdiff_t *tgt_offsets, int32_t arg_num) {
|
||||
// use one team and the default number of threads.
|
||||
const int32_t team_num = 1;
|
||||
const int32_t thread_limit = 0;
|
||||
return __tgt_rtl_run_target_team_region(device_id, tgt_entry_ptr, tgt_args,
|
||||
tgt_offsets, arg_num, team_num, thread_limit, 0);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
VERS1.0 {
|
||||
global:
|
||||
__tgt_rtl_is_valid_binary;
|
||||
__tgt_rtl_number_of_devices;
|
||||
__tgt_rtl_init_device;
|
||||
__tgt_rtl_load_binary;
|
||||
__tgt_rtl_data_alloc;
|
||||
__tgt_rtl_data_submit;
|
||||
__tgt_rtl_data_retrieve;
|
||||
__tgt_rtl_data_delete;
|
||||
__tgt_rtl_run_target_team_region;
|
||||
__tgt_rtl_run_target_region;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
@@ -0,0 +1,319 @@
|
||||
//===-RTLs/generic-64bit/src/rtl.cpp - Target RTLs Implementation - C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// RTL for generic 64-bit machine
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <dlfcn.h>
|
||||
#include <ffi.h>
|
||||
#include <gelf.h>
|
||||
#include <link.h>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#include "omptargetplugin.h"
|
||||
|
||||
#ifndef TARGET_NAME
|
||||
#define TARGET_NAME Generic ELF - 64bit
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_ELF_ID
|
||||
#define TARGET_ELF_ID 0
|
||||
#endif
|
||||
|
||||
#define GETNAME2(name) #name
|
||||
#define GETNAME(name) GETNAME2(name)
|
||||
#define DP(...) DEBUGP("Target " GETNAME(TARGET_NAME) " RTL", __VA_ARGS__)
|
||||
|
||||
#include "../../common/elf_common.c"
|
||||
|
||||
#define NUMBER_OF_DEVICES 4
|
||||
#define OFFLOADSECTIONNAME ".omp_offloading.entries"
|
||||
|
||||
/// Array of Dynamic libraries loaded for this target.
|
||||
struct DynLibTy {
|
||||
char *FileName;
|
||||
void *Handle;
|
||||
};
|
||||
|
||||
/// Keep entries table per device.
|
||||
struct FuncOrGblEntryTy {
|
||||
__tgt_target_table Table;
|
||||
};
|
||||
|
||||
/// Class containing all the device information.
|
||||
class RTLDeviceInfoTy {
|
||||
std::vector<FuncOrGblEntryTy> FuncGblEntries;
|
||||
|
||||
public:
|
||||
std::list<DynLibTy> DynLibs;
|
||||
|
||||
// Record entry point associated with device.
|
||||
void createOffloadTable(int32_t device_id, __tgt_offload_entry *begin,
|
||||
__tgt_offload_entry *end) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
E.Table.EntriesBegin = begin;
|
||||
E.Table.EntriesEnd = end;
|
||||
}
|
||||
|
||||
// Return true if the entry is associated with device.
|
||||
bool findOffloadEntry(int32_t device_id, void *addr) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
for (__tgt_offload_entry *i = E.Table.EntriesBegin, *e = E.Table.EntriesEnd;
|
||||
i < e; ++i) {
|
||||
if (i->addr == addr)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return the pointer to the target entries table.
|
||||
__tgt_target_table *getOffloadEntriesTable(int32_t device_id) {
|
||||
assert(device_id < (int32_t)FuncGblEntries.size() &&
|
||||
"Unexpected device id!");
|
||||
FuncOrGblEntryTy &E = FuncGblEntries[device_id];
|
||||
|
||||
return &E.Table;
|
||||
}
|
||||
|
||||
RTLDeviceInfoTy(int32_t num_devices) { FuncGblEntries.resize(num_devices); }
|
||||
|
||||
~RTLDeviceInfoTy() {
|
||||
// Close dynamic libraries
|
||||
for (auto &lib : DynLibs) {
|
||||
if (lib.Handle) {
|
||||
dlclose(lib.Handle);
|
||||
remove(lib.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static RTLDeviceInfoTy DeviceInfo(NUMBER_OF_DEVICES);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *image) {
|
||||
// If we don't have a valid ELF ID we can just fail.
|
||||
#if TARGET_ELF_ID < 1
|
||||
return 0;
|
||||
#else
|
||||
return elf_check_machine(image, TARGET_ELF_ID);
|
||||
#endif
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_number_of_devices() { return NUMBER_OF_DEVICES; }
|
||||
|
||||
int32_t __tgt_rtl_init_device(int32_t device_id) { return OFFLOAD_SUCCESS; }
|
||||
|
||||
__tgt_target_table *__tgt_rtl_load_binary(int32_t device_id,
|
||||
__tgt_device_image *image) {
|
||||
|
||||
DP("Dev %d: load binary from " DPxMOD " image\n", device_id,
|
||||
DPxPTR(image->ImageStart));
|
||||
|
||||
assert(device_id >= 0 && device_id < NUMBER_OF_DEVICES && "bad dev id");
|
||||
|
||||
size_t ImageSize = (size_t)image->ImageEnd - (size_t)image->ImageStart;
|
||||
size_t NumEntries = (size_t)(image->EntriesEnd - image->EntriesBegin);
|
||||
DP("Expecting to have %zd entries defined.\n", NumEntries);
|
||||
|
||||
// Is the library version incompatible with the header file?
|
||||
if (elf_version(EV_CURRENT) == EV_NONE) {
|
||||
DP("Incompatible ELF library!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Obtain elf handler
|
||||
Elf *e = elf_memory((char *)image->ImageStart, ImageSize);
|
||||
if (!e) {
|
||||
DP("Unable to get ELF handle: %s!\n", elf_errmsg(-1));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (elf_kind(e) != ELF_K_ELF) {
|
||||
DP("Invalid Elf kind!\n");
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Find the entries section offset
|
||||
Elf_Scn *section = 0;
|
||||
Elf64_Off entries_offset = 0;
|
||||
|
||||
size_t shstrndx;
|
||||
|
||||
if (elf_getshdrstrndx(e, &shstrndx)) {
|
||||
DP("Unable to get ELF strings index!\n");
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while ((section = elf_nextscn(e, section))) {
|
||||
GElf_Shdr hdr;
|
||||
gelf_getshdr(section, &hdr);
|
||||
|
||||
if (!strcmp(elf_strptr(e, shstrndx, hdr.sh_name), OFFLOADSECTIONNAME)) {
|
||||
entries_offset = hdr.sh_addr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!entries_offset) {
|
||||
DP("Entries Section Offset Not Found\n");
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DP("Offset of entries section is (" DPxMOD ").\n", DPxPTR(entries_offset));
|
||||
|
||||
// load dynamic library and get the entry points. We use the dl library
|
||||
// to do the loading of the library, but we could do it directly to avoid the
|
||||
// dump to the temporary file.
|
||||
//
|
||||
// 1) Create tmp file with the library contents.
|
||||
// 2) Use dlopen to load the file and dlsym to retrieve the symbols.
|
||||
char tmp_name[] = "/tmp/tmpfile_XXXXXX";
|
||||
int tmp_fd = mkstemp(tmp_name);
|
||||
|
||||
if (tmp_fd == -1) {
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FILE *ftmp = fdopen(tmp_fd, "wb");
|
||||
|
||||
if (!ftmp) {
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fwrite(image->ImageStart, ImageSize, 1, ftmp);
|
||||
fclose(ftmp);
|
||||
|
||||
DynLibTy Lib = {tmp_name, dlopen(tmp_name, RTLD_LAZY)};
|
||||
|
||||
if (!Lib.Handle) {
|
||||
DP("Target library loading error: %s\n", dlerror());
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DeviceInfo.DynLibs.push_back(Lib);
|
||||
|
||||
struct link_map *libInfo = (struct link_map *)Lib.Handle;
|
||||
|
||||
// The place where the entries info is loaded is the library base address
|
||||
// plus the offset determined from the ELF file.
|
||||
Elf64_Addr entries_addr = libInfo->l_addr + entries_offset;
|
||||
|
||||
DP("Pointer to first entry to be loaded is (" DPxMOD ").\n",
|
||||
DPxPTR(entries_addr));
|
||||
|
||||
// Table of pointers to all the entries in the target.
|
||||
__tgt_offload_entry *entries_table = (__tgt_offload_entry *)entries_addr;
|
||||
|
||||
__tgt_offload_entry *entries_begin = &entries_table[0];
|
||||
__tgt_offload_entry *entries_end = entries_begin + NumEntries;
|
||||
|
||||
if (!entries_begin) {
|
||||
DP("Can't obtain entries begin\n");
|
||||
elf_end(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DP("Entries table range is (" DPxMOD ")->(" DPxMOD ")\n",
|
||||
DPxPTR(entries_begin), DPxPTR(entries_end));
|
||||
DeviceInfo.createOffloadTable(device_id, entries_begin, entries_end);
|
||||
|
||||
elf_end(e);
|
||||
|
||||
return DeviceInfo.getOffloadEntriesTable(device_id);
|
||||
}
|
||||
|
||||
void *__tgt_rtl_data_alloc(int32_t device_id, int64_t size, void *hst_ptr) {
|
||||
void *ptr = malloc(size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_submit(int32_t device_id, void *tgt_ptr, void *hst_ptr,
|
||||
int64_t size) {
|
||||
memcpy(tgt_ptr, hst_ptr, size);
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_retrieve(int32_t device_id, void *hst_ptr, void *tgt_ptr,
|
||||
int64_t size) {
|
||||
memcpy(hst_ptr, tgt_ptr, size);
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_data_delete(int32_t device_id, void *tgt_ptr) {
|
||||
free(tgt_ptr);
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_run_target_team_region(int32_t device_id, void *tgt_entry_ptr,
|
||||
void **tgt_args, ptrdiff_t *tgt_offsets, int32_t arg_num, int32_t team_num,
|
||||
int32_t thread_limit, uint64_t loop_tripcount /*not used*/) {
|
||||
// ignore team num and thread limit.
|
||||
|
||||
// Use libffi to launch execution.
|
||||
ffi_cif cif;
|
||||
|
||||
// All args are references.
|
||||
std::vector<ffi_type *> args_types(arg_num, &ffi_type_pointer);
|
||||
std::vector<void *> args(arg_num);
|
||||
std::vector<void *> ptrs(arg_num);
|
||||
|
||||
for (int32_t i = 0; i < arg_num; ++i) {
|
||||
ptrs[i] = (void *)((intptr_t)tgt_args[i] + tgt_offsets[i]);
|
||||
args[i] = &ptrs[i];
|
||||
}
|
||||
|
||||
ffi_status status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI, arg_num,
|
||||
&ffi_type_void, &args_types[0]);
|
||||
|
||||
assert(status == FFI_OK && "Unable to prepare target launch!");
|
||||
|
||||
if (status != FFI_OK)
|
||||
return OFFLOAD_FAIL;
|
||||
|
||||
DP("Running entry point at " DPxMOD "...\n", DPxPTR(tgt_entry_ptr));
|
||||
|
||||
void (*entry)(void);
|
||||
*((void**) &entry) = tgt_entry_ptr;
|
||||
ffi_call(&cif, entry, NULL, &args[0]);
|
||||
return OFFLOAD_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t __tgt_rtl_run_target_region(int32_t device_id, void *tgt_entry_ptr,
|
||||
void **tgt_args, ptrdiff_t *tgt_offsets, int32_t arg_num) {
|
||||
// use one team and one thread.
|
||||
return __tgt_rtl_run_target_team_region(device_id, tgt_entry_ptr, tgt_args,
|
||||
tgt_offsets, arg_num, 1, 1, 0);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build a plugin for a ppc64 machine if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
build_generic_elf64("ppc64" "PPC64" "ppc64" "powerpc64-ibm-linux-gnu" "21")
|
||||
else()
|
||||
libomptarget_say("Not building ppc64 offloading plugin: machine not found in the system.")
|
||||
endif()
|
||||
@@ -0,0 +1,18 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build a plugin for a ppc64le machine if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
build_generic_elf64("ppc64le" "PPC64le" "ppc64" "powerpc64le-ibm-linux-gnu" "21")
|
||||
else()
|
||||
libomptarget_say("Not building ppc64le offloading plugin: machine not found in the system.")
|
||||
endif()
|
||||
@@ -0,0 +1,18 @@
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is dual licensed under the MIT and the University of Illinois Open
|
||||
# Source Licenses. See LICENSE.txt for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Build a plugin for a x86_64 machine if available.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
build_generic_elf64("x86_64" "x86_64" "x86_64" "x86_64-pc-linux-gnu" "62")
|
||||
else()
|
||||
libomptarget_say("Not building x86_64 offloading plugin: machine not found in the system.")
|
||||
endif()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,237 @@
|
||||
//===-------- omptarget.h - Target independent OpenMP target RTL -- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Interface to be used by Clang during the codegen of a
|
||||
// target region.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _OMPTARGET_H_
|
||||
#define _OMPTARGET_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define OFFLOAD_SUCCESS (0)
|
||||
#define OFFLOAD_FAIL (~0)
|
||||
|
||||
#define OFFLOAD_DEVICE_DEFAULT -1
|
||||
#define HOST_DEVICE -10
|
||||
|
||||
/// Data attributes for each data reference used in an OpenMP target region.
|
||||
enum tgt_map_type {
|
||||
// No flags
|
||||
OMP_TGT_MAPTYPE_NONE = 0x000,
|
||||
// copy data from host to device
|
||||
OMP_TGT_MAPTYPE_TO = 0x001,
|
||||
// copy data from device to host
|
||||
OMP_TGT_MAPTYPE_FROM = 0x002,
|
||||
// copy regardless of the reference count
|
||||
OMP_TGT_MAPTYPE_ALWAYS = 0x004,
|
||||
// force unmapping of data
|
||||
OMP_TGT_MAPTYPE_DELETE = 0x008,
|
||||
// map the pointer as well as the pointee
|
||||
OMP_TGT_MAPTYPE_PTR_AND_OBJ = 0x010,
|
||||
// pass device base address to kernel
|
||||
OMP_TGT_MAPTYPE_TARGET_PARAM = 0x020,
|
||||
// return base device address of mapped data
|
||||
OMP_TGT_MAPTYPE_RETURN_PARAM = 0x040,
|
||||
// private variable - not mapped
|
||||
OMP_TGT_MAPTYPE_PRIVATE = 0x080,
|
||||
// copy by value - not mapped
|
||||
OMP_TGT_MAPTYPE_LITERAL = 0x100,
|
||||
// mapping is implicit
|
||||
OMP_TGT_MAPTYPE_IMPLICIT = 0x200,
|
||||
// member of struct, member given by 4 MSBs - 1
|
||||
OMP_TGT_MAPTYPE_MEMBER_OF = 0xffff000000000000
|
||||
};
|
||||
|
||||
enum OpenMPOffloadingDeclareTargetFlags {
|
||||
/// Mark the entry as having a 'link' attribute.
|
||||
OMP_DECLARE_TARGET_LINK = 0x01,
|
||||
/// Mark the entry as being a global constructor.
|
||||
OMP_DECLARE_TARGET_CTOR = 0x02,
|
||||
/// Mark the entry as being a global destructor.
|
||||
OMP_DECLARE_TARGET_DTOR = 0x04
|
||||
};
|
||||
|
||||
/// This struct is a record of an entry point or global. For a function
|
||||
/// entry point the size is expected to be zero
|
||||
struct __tgt_offload_entry {
|
||||
void *addr; // Pointer to the offload entry info (function or global)
|
||||
char *name; // Name of the function or global
|
||||
size_t size; // Size of the entry info (0 if it is a function)
|
||||
int32_t flags; // Flags associated with the entry, e.g. 'link'.
|
||||
int32_t reserved; // Reserved, to be used by the runtime library.
|
||||
};
|
||||
|
||||
/// This struct is a record of the device image information
|
||||
struct __tgt_device_image {
|
||||
void *ImageStart; // Pointer to the target code start
|
||||
void *ImageEnd; // Pointer to the target code end
|
||||
__tgt_offload_entry *EntriesBegin; // Begin of table with all target entries
|
||||
__tgt_offload_entry *EntriesEnd; // End of table (non inclusive)
|
||||
};
|
||||
|
||||
/// This struct is a record of all the host code that may be offloaded to a
|
||||
/// target.
|
||||
struct __tgt_bin_desc {
|
||||
int32_t NumDeviceImages; // Number of device types supported
|
||||
__tgt_device_image *DeviceImages; // Array of device images (1 per dev. type)
|
||||
__tgt_offload_entry *HostEntriesBegin; // Begin of table with all host entries
|
||||
__tgt_offload_entry *HostEntriesEnd; // End of table (non inclusive)
|
||||
};
|
||||
|
||||
/// This struct contains the offload entries identified by the target runtime
|
||||
struct __tgt_target_table {
|
||||
__tgt_offload_entry *EntriesBegin; // Begin of the table with all the entries
|
||||
__tgt_offload_entry
|
||||
*EntriesEnd; // End of the table with all the entries (non inclusive)
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Implemented in libomp, they are called from within __tgt_* functions.
|
||||
int omp_get_default_device(void) __attribute__((weak));
|
||||
int32_t __kmpc_omp_taskwait(void *loc_ref, int32_t gtid) __attribute__((weak));
|
||||
|
||||
int omp_get_num_devices(void);
|
||||
int omp_get_initial_device(void);
|
||||
void *omp_target_alloc(size_t size, int device_num);
|
||||
void omp_target_free(void *device_ptr, int device_num);
|
||||
int omp_target_is_present(void *ptr, int device_num);
|
||||
int omp_target_memcpy(void *dst, void *src, size_t length, size_t dst_offset,
|
||||
size_t src_offset, int dst_device, int src_device);
|
||||
int omp_target_memcpy_rect(void *dst, void *src, size_t element_size,
|
||||
int num_dims, const size_t *volume, const size_t *dst_offsets,
|
||||
const size_t *src_offsets, const size_t *dst_dimensions,
|
||||
const size_t *src_dimensions, int dst_device, int src_device);
|
||||
int omp_target_associate_ptr(void *host_ptr, void *device_ptr, size_t size,
|
||||
size_t device_offset, int device_num);
|
||||
int omp_target_disassociate_ptr(void *host_ptr, int device_num);
|
||||
|
||||
/// adds a target shared library to the target execution image
|
||||
void __tgt_register_lib(__tgt_bin_desc *desc);
|
||||
|
||||
/// removes a target shared library from the target execution image
|
||||
void __tgt_unregister_lib(__tgt_bin_desc *desc);
|
||||
|
||||
// creates the host to target data mapping, stores it in the
|
||||
// libomptarget.so internal structure (an entry in a stack of data maps) and
|
||||
// passes the data to the device;
|
||||
void __tgt_target_data_begin(int32_t device_id, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes,
|
||||
int32_t *arg_types);
|
||||
void __tgt_target_data_begin_nowait(int32_t device_id, int32_t arg_num,
|
||||
void **args_base, void **args,
|
||||
int64_t *arg_sizes, int32_t *arg_types,
|
||||
int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum,
|
||||
void *noAliasDepList);
|
||||
|
||||
// passes data from the target, release target memory and destroys the
|
||||
// host-target mapping (top entry from the stack of data maps) created by
|
||||
// the last __tgt_target_data_begin
|
||||
void __tgt_target_data_end(int32_t device_id, int32_t arg_num, void **args_base,
|
||||
void **args, int64_t *arg_sizes, int32_t *arg_types);
|
||||
void __tgt_target_data_end_nowait(int32_t device_id, int32_t arg_num,
|
||||
void **args_base, void **args,
|
||||
int64_t *arg_sizes, int32_t *arg_types,
|
||||
int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum, void *noAliasDepList);
|
||||
|
||||
/// passes data to/from the target
|
||||
void __tgt_target_data_update(int32_t device_id, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes,
|
||||
int32_t *arg_types);
|
||||
void __tgt_target_data_update_nowait(int32_t device_id, int32_t arg_num,
|
||||
void **args_base, void **args,
|
||||
int64_t *arg_sizes, int32_t *arg_types,
|
||||
int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum,
|
||||
void *noAliasDepList);
|
||||
|
||||
// Performs the same actions as data_begin in case arg_num is non-zero
|
||||
// and initiates run of offloaded region on target platform; if arg_num
|
||||
// is non-zero after the region execution is done it also performs the
|
||||
// same action as data_end above. The following types are used; this
|
||||
// function returns 0 if it was able to transfer the execution to a
|
||||
// target and an int different from zero otherwise.
|
||||
int __tgt_target(int32_t device_id, void *host_ptr, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes,
|
||||
int32_t *arg_types);
|
||||
int __tgt_target_nowait(int32_t device_id, void *host_ptr, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes,
|
||||
int32_t *arg_types, int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum, void *noAliasDepList);
|
||||
|
||||
int __tgt_target_teams(int32_t device_id, void *host_ptr, int32_t arg_num,
|
||||
void **args_base, void **args, int64_t *arg_sizes,
|
||||
int32_t *arg_types, int32_t num_teams,
|
||||
int32_t thread_limit);
|
||||
int __tgt_target_teams_nowait(int32_t device_id, void *host_ptr,
|
||||
int32_t arg_num, void **args_base, void **args,
|
||||
int64_t *arg_sizes, int32_t *arg_types,
|
||||
int32_t num_teams, int32_t thread_limit,
|
||||
int32_t depNum, void *depList,
|
||||
int32_t noAliasDepNum, void *noAliasDepList);
|
||||
void __kmpc_push_target_tripcount(int32_t device_id, uint64_t loop_tripcount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OMPTARGET_DEBUG
|
||||
#include <stdio.h>
|
||||
#define DEBUGP(prefix, ...) \
|
||||
{ \
|
||||
fprintf(stderr, "%s --> ", prefix); \
|
||||
fprintf(stderr, __VA_ARGS__); \
|
||||
}
|
||||
|
||||
#ifndef __STDC_FORMAT_MACROS
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#define DPxMOD "0x%0*" PRIxPTR
|
||||
#define DPxPTR(ptr) ((int)(2*sizeof(uintptr_t))), ((uintptr_t) (ptr))
|
||||
|
||||
/*
|
||||
* To printf a pointer in hex with a fixed width of 16 digits and a leading 0x,
|
||||
* use printf("ptr=" DPxMOD "...\n", DPxPTR(ptr));
|
||||
*
|
||||
* DPxMOD expands to:
|
||||
* "0x%0*" PRIxPTR
|
||||
* where PRIxPTR expands to an appropriate modifier for the type uintptr_t on a
|
||||
* specific platform, e.g. "lu" if uintptr_t is typedef'd as unsigned long:
|
||||
* "0x%0*lu"
|
||||
*
|
||||
* Ultimately, the whole statement expands to:
|
||||
* printf("ptr=0x%0*lu...\n", // the 0* modifier expects an extra argument
|
||||
* // specifying the width of the output
|
||||
* (int)(2*sizeof(uintptr_t)), // the extra argument specifying the width
|
||||
* // 8 digits for 32bit systems
|
||||
* // 16 digits for 64bit
|
||||
* (uintptr_t) ptr);
|
||||
*/
|
||||
#else
|
||||
#define DEBUGP(prefix, ...) \
|
||||
{}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#endif // _OMPTARGET_H_
|
||||
@@ -0,0 +1,92 @@
|
||||
//===-- omptargetplugin.h - Target dependent OpenMP Plugin API --*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines an interface between target independent OpenMP offload
|
||||
// runtime library libomptarget and target dependent plugin.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _OMPTARGETPLUGIN_H_
|
||||
#define _OMPTARGETPLUGIN_H_
|
||||
|
||||
#include <omptarget.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Return the number of available devices of the type supported by the
|
||||
// target RTL.
|
||||
int32_t __tgt_rtl_number_of_devices(void);
|
||||
|
||||
// Return an integer different from zero if the provided device image can be
|
||||
// supported by the runtime. The functionality is similar to comparing the
|
||||
// result of __tgt__rtl__load__binary to NULL. However, this is meant to be a
|
||||
// lightweight query to determine if the RTL is suitable for an image without
|
||||
// having to load the library, which can be expensive.
|
||||
int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image);
|
||||
|
||||
// Initialize the specified device. In case of success return 0; otherwise
|
||||
// return an error code.
|
||||
int32_t __tgt_rtl_init_device(int32_t ID);
|
||||
|
||||
// Pass an executable image section described by image to the specified
|
||||
// device and prepare an address table of target entities. In case of error,
|
||||
// return NULL. Otherwise, return a pointer to the built address table.
|
||||
// Individual entries in the table may also be NULL, when the corresponding
|
||||
// offload region is not supported on the target device.
|
||||
__tgt_target_table *__tgt_rtl_load_binary(int32_t ID,
|
||||
__tgt_device_image *Image);
|
||||
|
||||
// Allocate data on the particular target device, of the specified size.
|
||||
// HostPtr is a address of the host data the allocated target data
|
||||
// will be associated with (HostPtr may be NULL if it is not known at
|
||||
// allocation time, like for example it would be for target data that
|
||||
// is allocated by omp_target_alloc() API). Return address of the
|
||||
// allocated data on the target that will be used by libomptarget.so to
|
||||
// initialize the target data mapping structures. These addresses are
|
||||
// used to generate a table of target variables to pass to
|
||||
// __tgt_rtl_run_region(). The __tgt_rtl_data_alloc() returns NULL in
|
||||
// case an error occurred on the target device.
|
||||
void *__tgt_rtl_data_alloc(int32_t ID, int64_t Size, void *HostPtr);
|
||||
|
||||
// Pass the data content to the target device using the target address.
|
||||
// In case of success, return zero. Otherwise, return an error code.
|
||||
int32_t __tgt_rtl_data_submit(int32_t ID, void *TargetPtr, void *HostPtr,
|
||||
int64_t Size);
|
||||
|
||||
// Retrieve the data content from the target device using its address.
|
||||
// In case of success, return zero. Otherwise, return an error code.
|
||||
int32_t __tgt_rtl_data_retrieve(int32_t ID, void *HostPtr, void *TargetPtr,
|
||||
int64_t Size);
|
||||
|
||||
// De-allocate the data referenced by target ptr on the device. In case of
|
||||
// success, return zero. Otherwise, return an error code.
|
||||
int32_t __tgt_rtl_data_delete(int32_t ID, void *TargetPtr);
|
||||
|
||||
// Transfer control to the offloaded entry Entry on the target device.
|
||||
// Args and Offsets are arrays of NumArgs size of target addresses and
|
||||
// offsets. An offset should be added to the target address before passing it
|
||||
// to the outlined function on device side. In case of success, return zero.
|
||||
// Otherwise, return an error code.
|
||||
int32_t __tgt_rtl_run_target_region(int32_t ID, void *Entry, void **Args,
|
||||
ptrdiff_t *Offsets, int32_t NumArgs);
|
||||
|
||||
// Similar to __tgt_rtl_run_target_region, but additionally specify the
|
||||
// number of teams to be created and a number of threads in each team.
|
||||
int32_t __tgt_rtl_run_target_team_region(int32_t ID, void *Entry, void **Args,
|
||||
ptrdiff_t *Offsets, int32_t NumArgs,
|
||||
int32_t NumTeams, int32_t ThreadLimit,
|
||||
uint64_t loop_tripcount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _OMPTARGETPLUGIN_H_
|
||||
@@ -0,0 +1,92 @@
|
||||
# CMakeLists.txt file for unit testing OpenMP Library
|
||||
include(FindPythonInterp)
|
||||
include(CheckTypeSize)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
libomptarget_warning_say("Could not find Python.")
|
||||
libomptarget_warning_say("The check-libomptarget target will not be available!")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(LIBOMPTARGET_TEST_CFLAGS "" CACHE STRING
|
||||
"Extra compiler flags to send to the test compiler")
|
||||
|
||||
if(${LIBOMPTARGET_STANDALONE_BUILD})
|
||||
# Make sure we can use the console pool for recent cmake and ninja > 1.5
|
||||
if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
|
||||
set(cmake_3_2_USES_TERMINAL)
|
||||
else()
|
||||
set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
|
||||
endif()
|
||||
set(LIBOMPTARGET_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
|
||||
"C compiler to use for testing OpenMP offloading library")
|
||||
set(LIBOMPTARGET_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING
|
||||
"C++ compiler to use for testing OpenMP offloading library")
|
||||
set(LIBOMPTARGET_TEST_OPENMP_FLAG -fopenmp CACHE STRING
|
||||
"OpenMP compiler flag to use for testing OpenMP offloading library")
|
||||
find_program(LIBOMPTARGET_LLVM_LIT_EXECUTABLE
|
||||
NAMES llvm-lit lit.py lit
|
||||
PATHS ${OPENMP_LLVM_TOOLS_DIR})
|
||||
if(NOT LIBOMPTARGET_LLVM_LIT_EXECUTABLE)
|
||||
libomptarget_say("Cannot find llvm-lit.")
|
||||
libomptarget_say("Please put llvm-lit in your PATH or set LIBOMPTARGET_LLVM_LIT_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory")
|
||||
libomptarget_warning_say("The check-libomptarget target will not be available!")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_program(LIBOMPTARGET_FILECHECK_EXECUTABLE
|
||||
NAMES FileCheck
|
||||
PATHS ${OPENMP_LLVM_TOOLS_DIR})
|
||||
if(NOT LIBOMPTARGET_FILECHECK_EXECUTABLE)
|
||||
libomptarget_say("Cannot find FileCheck.")
|
||||
libomptarget_say("Please put FileCheck in your PATH or set LIBOMPTARGET_FILECHECK_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory")
|
||||
libomptarget_warning_say("The check-libomptarget target will not be available!")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Set lit arguments
|
||||
# The -j 1 lets the actual tests run with the entire machine.
|
||||
# We have one test thread that spawns the tests serially. This allows
|
||||
# Each test to use the entire machine.
|
||||
set(LIBOMPTARGET_LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail -j 1")
|
||||
if(MSVC OR XCODE)
|
||||
set(LIBOMPTARGET_LIT_ARGS_DEFAULT "${LIBOMPTARGET_LIT_ARGS_DEFAULT} --no-progress-bar")
|
||||
endif()
|
||||
set(LIBOMPTARGET_LIT_ARGS "${LIBOMPTARGET_LIT_ARGS_DEFAULT}" CACHE STRING
|
||||
"Default options for lit")
|
||||
separate_arguments(LIBOMPTARGET_LIT_ARGS)
|
||||
add_custom_target(check-libomptarget
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${LIBOMPTARGET_LLVM_LIT_EXECUTABLE} ${LIBOMPTARGET_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS omptarget
|
||||
COMMENT "Running libomptarget tests"
|
||||
${cmake_3_2_USES_TERMINAL}
|
||||
)
|
||||
|
||||
set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/../../runtime/src" CACHE STRING
|
||||
"Path to folder containing omp.h")
|
||||
set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/../../runtime/src" CACHE STRING
|
||||
"Path to folder containing libomp.so")
|
||||
else()
|
||||
# LLVM source tree build, test just-built clang
|
||||
if(NOT MSVC)
|
||||
set(LIBOMPTARGET_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
|
||||
set(LIBOMPTARGET_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
|
||||
set(LIBOMPTARGET_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
|
||||
else()
|
||||
libomptarget_warning_say("Not prepared to run tests on Windows systems.")
|
||||
endif()
|
||||
set(LIBOMPTARGET_TEST_OPENMP_FLAG -fopenmp=libomp)
|
||||
# Use add_lit_testsuite() from LLVM CMake. This also depends on OpenMP
|
||||
# implementation because it uses omp.h.
|
||||
add_lit_testsuite(check-libomptarget
|
||||
"Running libomptarget tests"
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS omptarget omp
|
||||
)
|
||||
|
||||
set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMPTARGET_BINARY_DIR}/../runtime/src")
|
||||
endif()
|
||||
|
||||
# Configure the lit.site.cfg.in file
|
||||
set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
|
||||
configure_file(lit.site.cfg.in lit.site.cfg @ONLY)
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
|
||||
# Configuration file for the 'lit' test runner.
|
||||
|
||||
import os
|
||||
import lit.formats
|
||||
|
||||
# Tell pylint that we know config and lit_config exist somewhere.
|
||||
if 'PYLINT_IMPORT' in os.environ:
|
||||
config = object()
|
||||
lit_config = object()
|
||||
|
||||
def append_dynamic_library_path(name, value, sep):
|
||||
if name in config.environment:
|
||||
config.environment[name] = value + sep + config.environment[name]
|
||||
else:
|
||||
config.environment[name] = value
|
||||
|
||||
# name: The name of this test suite.
|
||||
config.name = 'libomptarget'
|
||||
|
||||
# suffixes: A list of file extensions to treat as test files.
|
||||
config.suffixes = ['.c', '.cpp', '.cc']
|
||||
|
||||
# test_source_root: The root path where tests are located.
|
||||
config.test_source_root = os.path.dirname(__file__)
|
||||
|
||||
# test_exec_root: The root object directory where output is placed
|
||||
config.test_exec_root = config.libomptarget_obj_root
|
||||
|
||||
# test format
|
||||
config.test_format = lit.formats.ShTest()
|
||||
|
||||
# compiler flags
|
||||
config.test_cflags = config.test_openmp_flag + \
|
||||
" -I " + config.test_source_root + \
|
||||
" -I " + config.omp_header_directory + \
|
||||
" -L " + config.library_dir;
|
||||
|
||||
if config.omp_host_rtl_directory:
|
||||
config.test_cflags = config.test_cflags + " -L " + \
|
||||
config.omp_host_rtl_directory
|
||||
|
||||
config.test_cflags = config.test_cflags + " " + config.test_extra_cflags
|
||||
|
||||
# Setup environment to find dynamic library at runtime
|
||||
if config.operating_system == 'Windows':
|
||||
append_dynamic_library_path('PATH', config.library_dir, ";")
|
||||
append_dynamic_library_path('PATH', config.omp_host_rtl_directory, ";")
|
||||
elif config.operating_system == 'Darwin':
|
||||
append_dynamic_library_path('DYLD_LIBRARY_PATH', config.library_dir, ":")
|
||||
append_dynamic_library_path('DYLD_LIBRARY_PATH', \
|
||||
config.omp_host_rtl_directory, ";")
|
||||
config.test_cflags += " -Wl,-rpath," + config.library_dir
|
||||
config.test_cflags += " -Wl,-rpath," + config.omp_host_rtl_directory
|
||||
else: # Unices
|
||||
append_dynamic_library_path('LD_LIBRARY_PATH', config.library_dir, ":")
|
||||
append_dynamic_library_path('LD_LIBRARY_PATH', \
|
||||
config.omp_host_rtl_directory, ":")
|
||||
|
||||
# substitutions
|
||||
# - for targets that exist in the system create the actual command.
|
||||
# - for valid targets that do not exist in the system, return false, so that the
|
||||
# same test can be used for different targets.
|
||||
|
||||
# Scan all the valid targets.
|
||||
for libomptarget_target in config.libomptarget_all_targets:
|
||||
# Is this target in the current system? If so create a compile, run and test
|
||||
# command. Otherwise create command that return false.
|
||||
if libomptarget_target in config.libomptarget_system_targets:
|
||||
config.substitutions.append(("%libomptarget-compilexx-run-and-check-" + \
|
||||
libomptarget_target, \
|
||||
"%libomptarget-compilexx-and-run-" + libomptarget_target + \
|
||||
" | " + config.libomptarget_filecheck + " %s"))
|
||||
config.substitutions.append(("%libomptarget-compile-run-and-check-" + \
|
||||
libomptarget_target, \
|
||||
"%libomptarget-compile-and-run-" + libomptarget_target + \
|
||||
" | " + config.libomptarget_filecheck + " %s"))
|
||||
config.substitutions.append(("%libomptarget-compilexx-and-run-" + \
|
||||
libomptarget_target, \
|
||||
"%clangxx-" + libomptarget_target + " %s -o %t-" + \
|
||||
libomptarget_target + " && %t-" + libomptarget_target))
|
||||
config.substitutions.append(("%libomptarget-compile-and-run-" + \
|
||||
libomptarget_target, \
|
||||
"%clang-" + libomptarget_target + " %s -o %t-" + \
|
||||
libomptarget_target + " && %t-" + libomptarget_target))
|
||||
config.substitutions.append(("%clangxx-" + libomptarget_target, \
|
||||
"%clangxx %cflags -fopenmp-targets=" + libomptarget_target))
|
||||
config.substitutions.append(("%clang-" + libomptarget_target, \
|
||||
"%clang %cflags -fopenmp-targets=" + libomptarget_target))
|
||||
config.substitutions.append(("%fcheck-" + libomptarget_target, \
|
||||
config.libomptarget_filecheck + " %s"))
|
||||
else:
|
||||
config.substitutions.append(("%libomptarget-compile-run-and-check-" + \
|
||||
libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%libomptarget-compilexx-run-and-check-" + \
|
||||
libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%libomptarget-compile-and-run-" + \
|
||||
libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%libomptarget-compilexx-and-run-" + \
|
||||
libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%clang-" + libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%clangxx-" + libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
config.substitutions.append(("%fcheck-" + libomptarget_target, \
|
||||
"echo ignored-command"))
|
||||
|
||||
config.substitutions.append(("%clangxx", config.test_cxx_compiler))
|
||||
config.substitutions.append(("%clang", config.test_c_compiler))
|
||||
config.substitutions.append(("%openmp_flag", config.test_openmp_flag))
|
||||
config.substitutions.append(("%cflags", config.test_cflags))
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
@AUTO_GEN_COMMENT@
|
||||
|
||||
config.test_c_compiler = "@LIBOMPTARGET_TEST_C_COMPILER@"
|
||||
config.test_cxx_compiler = "@LIBOMPTARGET_TEST_CXX_COMPILER@"
|
||||
config.test_openmp_flag = "@LIBOMPTARGET_TEST_OPENMP_FLAG@"
|
||||
# For the moment we still need to pass libomptarget explicitly. Once the driver
|
||||
# patch, lands, this is not required anymore.
|
||||
config.test_extra_cflags = "-lomptarget @LIBOMPTARGET_TEST_CFLAGS@"
|
||||
config.libomptarget_obj_root = "@CMAKE_CURRENT_BINARY_DIR@"
|
||||
config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@"
|
||||
config.omp_header_directory = "@LIBOMPTARGET_OPENMP_HEADER_FOLDER@"
|
||||
config.omp_host_rtl_directory = "@LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER@"
|
||||
config.operating_system = "@CMAKE_SYSTEM_NAME@"
|
||||
config.libomptarget_all_targets = "@LIBOMPTARGET_ALL_TARGETS@".split()
|
||||
config.libomptarget_system_targets = "@LIBOMPTARGET_SYSTEM_TARGETS@".split()
|
||||
config.libomptarget_filecheck = "@LIBOMPTARGET_FILECHECK_EXECUTABLE@"
|
||||
|
||||
# Let the main config do the real work.
|
||||
lit_config.load_config(config, "@LIBOMPTARGET_BASE_DIR@/test/lit.cfg")
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// RUN: %libomptarget-compile-run-and-check-aarch64-unknown-linux-gnu
|
||||
// RUN: %libomptarget-compile-run-and-check-powerpc64-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compile-run-and-check-powerpc64le-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compile-run-and-check-x86_64-pc-linux-gnu
|
||||
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
|
||||
int main(void) {
|
||||
int isHost = -1;
|
||||
|
||||
#pragma omp target map(from: isHost)
|
||||
{ isHost = omp_is_initial_device(); }
|
||||
|
||||
if (isHost < 0) {
|
||||
printf("Runtime error, isHost=%d\n", isHost);
|
||||
}
|
||||
|
||||
// CHECK: Target region executed on the device
|
||||
printf("Target region executed on the %s\n", isHost ? "host" : "device");
|
||||
|
||||
return isHost;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// RUN: %libomptarget-compilexx-run-and-check-aarch64-unknown-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-powerpc64-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-powerpc64le-ibm-linux-gnu
|
||||
// RUN: %libomptarget-compilexx-run-and-check-x86_64-pc-linux-gnu
|
||||
|
||||
#include <stdio.h>
|
||||
#include <omp.h>
|
||||
|
||||
int main(void) {
|
||||
int isHost = 0;
|
||||
|
||||
#pragma omp target map(from: isHost)
|
||||
{ isHost = omp_is_initial_device(); }
|
||||
|
||||
if (isHost < 0) {
|
||||
printf("Runtime error, isHost=%d\n", isHost);
|
||||
}
|
||||
|
||||
// CHECK: Target region executed on the device
|
||||
printf("Target region executed on the %s\n", isHost ? "host" : "device");
|
||||
|
||||
return isHost;
|
||||
}
|
||||
+21
-5
@@ -14,6 +14,7 @@
|
||||
# root_dir - path to root directory of liboffload
|
||||
# build_dir - path to build directory
|
||||
# mpss_dir - path to root directory of mpss
|
||||
# mpss_version - version of the mpss (e.g., version "3.3.x" would be "33")
|
||||
# libiomp_host_dir - path to host libiomp directory (unnecessary if compiler_host is icc)
|
||||
# libiomp_target_dir - path to target libiomp directory (unnecesarry if compiler_target is icc)
|
||||
# omp_header_dir - path to omp.h (unnecessary if compiler_host and compiler_target are icc)
|
||||
@@ -47,13 +48,24 @@ compiler_host?=gcc
|
||||
compiler_target?=gcc
|
||||
|
||||
# MPSS
|
||||
mpss_version?=30
|
||||
mpss_dir?=/
|
||||
mpss_present=$(shell if test -d $(mpss_dir); then echo OK; else echo KO; fi)
|
||||
ifneq ($(mpss_present), OK)
|
||||
$(error "Cannot find MPSS directory $(mpss_dir)")
|
||||
endif
|
||||
|
||||
coi_dir=$(mpss_dir)/opt/intel/mic/coi
|
||||
ifeq ($(shell test $(mpss_version) -gt 33; echo $$?), 0)
|
||||
coi_dir=$(mpss_dir)/sysroots/k1om-mpss-linux/usr
|
||||
coi_include=$(coi_dir)/include/intel-coi
|
||||
coi_lib_host=$(mpss_dir)/lib64
|
||||
coi_lib_device=$(coi_dir)/lib64
|
||||
else
|
||||
coi_dir=$(mpss_dir)/opt/intel/mic/coi
|
||||
coi_include=$(coi_dir)/include
|
||||
coi_lib_host=$(coi_dir)/host-linux-release/lib
|
||||
coi_lib_device=$(coi_dir)/device-linux-release/lib
|
||||
endif
|
||||
myo_dir=$(mpss_dir)/opt/intel/mic/myo
|
||||
|
||||
# Sources
|
||||
@@ -90,25 +102,25 @@ obj_ofld_host=$(foreach file,$(obj_ofld),$(build_host_dir)/$(file))
|
||||
obj_ofld_target=$(foreach file,$(obj_ofld),$(build_target_dir)/$(file))
|
||||
|
||||
# Options
|
||||
opts_common=-O2 -w -fpic -c -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -I$(coi_dir)/include -I$(myo_dir)/include -I$(source_dir)
|
||||
opts_common=-O2 -w -fpic -c -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -I$(coi_include) -I$(myo_dir)/include -I$(source_dir)
|
||||
ifneq ($(omp_header_dir), )
|
||||
opts_common+=-I$(imported_dir)
|
||||
endif
|
||||
|
||||
opts_liboffload=-shared -Wl,-soname,liboffload.so.5 -ldl -lstdc++ -liomp5
|
||||
|
||||
opts_liboffload_host=$(opts_liboffload) -L$(coi_dir)/host-linux-release/lib -lcoi_host -L$(myo_dir)/lib -lmyo-client
|
||||
opts_liboffload_host=$(opts_liboffload) -L$(coi_lib_host) -lcoi_host -L$(myo_dir)/lib -lmyo-client
|
||||
ifneq ($(libiomp_host_dir), )
|
||||
opts_liboffload_host+=-L$(libiomp_host_dir)
|
||||
endif
|
||||
|
||||
opts_liboffload_target=$(opts_liboffload) -L$(coi_dir)/device-linux-release/lib -lcoi_device -L$(myo_dir)/lib -lmyo-service
|
||||
opts_liboffload_target=$(opts_liboffload) -L$(coi_lib_device) -lcoi_device -L$(myo_dir)/lib -lmyo-service
|
||||
ifneq ($(libiomp_target_dir), )
|
||||
opts_liboffload_target+=-L$(libiomp_target_dir)
|
||||
endif
|
||||
|
||||
options_host?=
|
||||
opts_host=$(options_host) -DHOST_LIBRARY=1
|
||||
opts_host=$(options_host) -DHOST_LIBRARY=1 -DMPSS_VERSION=$(mpss_version)
|
||||
ifeq ($(os_host), linux)
|
||||
opts_host+=-DLINUX
|
||||
endif
|
||||
@@ -118,6 +130,9 @@ opts_target=$(options_target) -DHOST_LIBRARY=0
|
||||
ifeq ($(os_target), linux)
|
||||
opts_target+=-DLINUX
|
||||
endif
|
||||
ifeq ($(compiler_target), icc)
|
||||
opts_target+=-mmic
|
||||
endif
|
||||
|
||||
# Make targets
|
||||
.PHONY: all clean info
|
||||
@@ -196,6 +211,7 @@ info:
|
||||
@echo "root_dir = $(root_dir)"
|
||||
@echo "build_dir = $(build_dir)"
|
||||
@echo "mpss_dir = $(mpss_dir)"
|
||||
@echo "mpss_version = $(mpss_version)"
|
||||
@echo "libiomp_host_dir = $(libiomp_host_dir)"
|
||||
@echo "libiomp_target_dir = $(libiomp_target_dir)"
|
||||
@echo "omp_header_dir = $(omp_header_dir)"
|
||||
|
||||
@@ -11,8 +11,12 @@
|
||||
#ifndef CEAN_UTIL_H_INCLUDED
|
||||
#define CEAN_UTIL_H_INCLUDED
|
||||
|
||||
#if MPSS_VERSION > 33
|
||||
#include <source/COIBuffer_source.h>
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
|
||||
#if MPSS_VERSION <= 33
|
||||
// CEAN expression representation
|
||||
struct dim_desc {
|
||||
int64_t size; // Length of data type
|
||||
@@ -27,6 +31,7 @@ struct arr_desc {
|
||||
int64_t rank; // Rank of array
|
||||
dim_desc dim[1];
|
||||
};
|
||||
#endif
|
||||
|
||||
struct CeanReadDim {
|
||||
int64_t count; // The number of elements in this dimension
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
---
|
||||
BasedOnStyle: LLVM
|
||||
AlignTrailingComments: false
|
||||
SortIncludes: false
|
||||
---
|
||||
# Language: Cpp
|
||||
# AccessModifierOffset: -2
|
||||
# AlignAfterOpenBracket: Align
|
||||
# AlignConsecutiveAssignments: false
|
||||
# AlignConsecutiveDeclarations: false
|
||||
# AlignEscapedNewlinesLeft: false
|
||||
# AlignOperands: false
|
||||
# AlignTrailingComments: false
|
||||
# AllowAllParametersOfDeclarationOnNextLine: true
|
||||
# AllowShortBlocksOnASingleLine: false
|
||||
# AllowShortCaseLabelsOnASingleLine: false
|
||||
# AllowShortFunctionsOnASingleLine: All
|
||||
# AllowShortIfStatementsOnASingleLine: false
|
||||
# AllowShortLoopsOnASingleLine: false
|
||||
# AlwaysBreakAfterDefinitionReturnType: None
|
||||
# AlwaysBreakAfterReturnType: None
|
||||
# AlwaysBreakBeforeMultilineStrings: false
|
||||
# AlwaysBreakTemplateDeclarations: false
|
||||
# BinPackArguments: true
|
||||
# BinPackParameters: true
|
||||
# BraceWrapping:
|
||||
# AfterClass: false
|
||||
# AfterControlStatement: false
|
||||
# AfterEnum: false
|
||||
# AfterFunction: false
|
||||
# AfterNamespace: false
|
||||
# AfterObjCDeclaration: false
|
||||
# AfterStruct: false
|
||||
# AfterUnion: false
|
||||
# BeforeCatch: false
|
||||
# BeforeElse: false
|
||||
# IndentBraces: false
|
||||
# # BreakBeforeBinaryOperators: None
|
||||
# BreakBeforeBraces: Attach
|
||||
# BreakBeforeTernaryOperators: true
|
||||
# BreakConstructorInitializersBeforeComma: false
|
||||
# ColumnLimit: 80
|
||||
# CommentPragmas: '^ IWYU pragma:'
|
||||
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
# ConstructorInitializerIndentWidth: 4
|
||||
# ContinuationIndentWidth: 4
|
||||
# Cpp11BracedListStyle: true
|
||||
# DerivePointerAlignment: false
|
||||
# DisableFormat: true
|
||||
# ExperimentalAutoDetectBinPacking: false
|
||||
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
||||
# IncludeCategories:
|
||||
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
# Priority: 2
|
||||
# - Regex: '^(<|"(gtest|isl|json)/)'
|
||||
# Priority: 3
|
||||
# - Regex: '.*'
|
||||
# Priority: 1
|
||||
# IndentCaseLabels: false
|
||||
# IndentWidth: 2
|
||||
# IndentWrappedFunctionNames: false
|
||||
# KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
# MacroBlockBegin: ''
|
||||
# MacroBlockEnd: ''
|
||||
# MaxEmptyLinesToKeep: 2
|
||||
# NamespaceIndentation: None
|
||||
# ObjCBlockIndentWidth: 2
|
||||
# ObjCSpaceAfterProperty: false
|
||||
# ObjCSpaceBeforeProtocolList: true
|
||||
# PenaltyBreakBeforeFirstCallParameter: 19
|
||||
# PenaltyBreakComment: 300
|
||||
# PenaltyBreakFirstLessLess: 120
|
||||
# PenaltyBreakString: 1000
|
||||
# PenaltyExcessCharacter: 1000000
|
||||
# PenaltyReturnTypeOnItsOwnLine: 60
|
||||
# PointerAlignment: Right
|
||||
# ReflowComments: true
|
||||
# SpaceAfterCStyleCast: false
|
||||
# SpaceBeforeAssignmentOperators: true
|
||||
# SpaceBeforeParens: ControlStatements
|
||||
# SpaceInEmptyParentheses: false
|
||||
# SpacesBeforeTrailingComments: 1
|
||||
# SpacesInAngles: false
|
||||
# SpacesInContainerLiterals: true
|
||||
# SpacesInCStyleCastParentheses: false
|
||||
# SpacesInParentheses: false
|
||||
# SpacesInSquareBrackets: false
|
||||
# Standard: Cpp11
|
||||
# TabWidth: 8
|
||||
# UseTab: Never
|
||||
...
|
||||
@@ -0,0 +1,229 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
==========================================================
|
||||
How to Build the LLVM* OpenMP* Runtime Library using CMake
|
||||
==========================================================
|
||||
|
||||
==== Version of CMake required: v2.8.0 or above ====
|
||||
|
||||
============================================
|
||||
How to call cmake initially, then repeatedly
|
||||
============================================
|
||||
- When calling cmake for the first time, all needed compiler options
|
||||
must be specified on the command line. After this initial call to
|
||||
cmake, the compiler definitions must not be included for further calls
|
||||
to cmake. Other options can be specified on the command line multiple
|
||||
times including all definitions in the Build options section below.
|
||||
- Example of configuring, building, reconfiguring, rebuilding:
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ARCH=i386 .. # Initial configuration
|
||||
$ make
|
||||
...
|
||||
$ make clean
|
||||
$ cmake -DLIBOMP_ARCH=x86_64 -DCMAKE_BUILD_TYPE=Debug .. # Second configuration
|
||||
$ make
|
||||
...
|
||||
$ rm -rf *
|
||||
$ cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ARCH=x86_64 .. # Third configuration
|
||||
$ make
|
||||
- Notice in the example how the compiler definitions are only specified
|
||||
for an empty build directory, but other Build options are used at any time.
|
||||
- The file CMakeCache.txt which is created after the first call to cmake
|
||||
is a configuration file which holds all the values for the Build options.
|
||||
These configuration values can be changed using a text editor to modify
|
||||
CMakeCache.txt as opposed to using definitions on the command line.
|
||||
- To have cmake create a particular type of build generator file simply
|
||||
inlude the -G <Generator name> option:
|
||||
$ cmake -G "Unix Makefiles" ...
|
||||
You can see a list of generators cmake supports by executing cmake with
|
||||
no arguments and a list will be printed.
|
||||
|
||||
=====================
|
||||
Instructions to Build
|
||||
=====================
|
||||
$ cd libomp_top_level/ [ directory with src/ , exports/ , tools/ , etc. ]
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
|
||||
[ Unix* Libraries ]
|
||||
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> ..
|
||||
|
||||
[ Intel(R) Many Integrated Core Library (Intel(R) MIC Library) ]
|
||||
$ cmake -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> -DLIBOMP_ARCH=mic ..
|
||||
|
||||
[ Windows Libraries ]
|
||||
$ cmake -G <Generator Type> -DCMAKE_C_COMPILER=<C Compiler> -DCMAKE_CXX_COMPILER=<C++ Compiler> -DCMAKE_ASM_MASM_COMPILER=[ml | ml64] -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
==================
|
||||
Mac* Fat Libraries
|
||||
==================
|
||||
On OS X* machines, it is possible to build universal (or fat) libraries which
|
||||
include both i386 and x86_64 architecture objects in a
|
||||
single archive.
|
||||
$ cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_OSX_ARCHITECTURES='i386;x86_64' ..
|
||||
$ make
|
||||
There is also an option -DLIBOMP_OSX_ARCHITECTURES which can be set in case
|
||||
this is an LLVM source tree build which will only set the libomp library
|
||||
to a universal fat library and prevent having the entire llvm/clang build
|
||||
produce universal binaries.
|
||||
|
||||
===========
|
||||
Micro tests
|
||||
===========
|
||||
After the library has been built, there are five optional microtests that
|
||||
can be performed. Some will be skipped based upon the platform.
|
||||
To run the tests,
|
||||
$ make libomp-micro-tests
|
||||
|
||||
=============
|
||||
CMake options
|
||||
=============
|
||||
-DCMAKE_C_COMPILER=<C compiler name>
|
||||
Specify the C compiler
|
||||
|
||||
-DCMAKE_CXX_COMPILER=<C++ compiler name>
|
||||
Specify the C++ compiler
|
||||
|
||||
-DCMAKE_Fortran_COMPILER=<Fortran compiler name>
|
||||
This option is only needed when -DLIBOMP_FORTRAN_MODULES is on.
|
||||
So typically, a Fortran compiler is not needed during the build.
|
||||
Specify the Fortran compiler
|
||||
|
||||
-DCMAKE_ASM_MASM_COMPILER=[ml | ml64 ]
|
||||
This option is Windows* Only
|
||||
|
||||
-DLIBOMP_ARCH=i386|x86_64|arm|ppc64|ppc64le|aarch64|mic
|
||||
The default for the option is chosen based on the probing the compiler for
|
||||
architecture macros (e.g., is __x86_64__ predefined by compiler?).
|
||||
|
||||
==== First values listed are the default value ====
|
||||
-DLIBOMP_LIB_TYPE=normal|profile|stubs
|
||||
Library type can be normal, profile, or stubs.
|
||||
|
||||
-DCMAKE_BUILD_TYPE=Release|Debug|RelWithDebInfo
|
||||
Build type can be Release, Debug, or RelWithDebInfo.
|
||||
|
||||
-DLIBOMP_OMP_VERSION=50|45|40|30
|
||||
OpenMP version can be either 50, 45, 40 or 30.
|
||||
|
||||
-DLIBOMP_MIC_ARCH=knc|knf
|
||||
This value is ignored if LIBOMP_ARCH != mic
|
||||
Intel(R) MIC Architecture, can be knf or knc.
|
||||
|
||||
-DLIBOMP_FORTRAN_MODULES=off|on
|
||||
Should the Fortran modules be created (requires Fortran compiler)
|
||||
|
||||
-DLIBOMP_USE_ADAPTIVE_LOCKS=on|off
|
||||
Should adaptive (TSX-based) locks be included?
|
||||
These are x86 specific. This feature is turned on by default
|
||||
for i386 and x86_64. Otherwise, it is turned off.
|
||||
|
||||
-DLIBOMP_USE_INTERNODE_ALIGNMENT=off|on
|
||||
Should 4096-byte alignment be used for certain data structures?
|
||||
This option is useful on multinode systems where a small CACHE_LINE
|
||||
setting leads to false sharing. This option is off by default.
|
||||
|
||||
-DLIBOMP_USE_VERSION_SYMBOLS=on|off
|
||||
Should versioned symbols be used for building the library?
|
||||
This option only makes sense for ELF based libraries where version
|
||||
symbols are supported (Linux, some BSD* variants). It is off
|
||||
by default for Windows and Mac, but on for other Unix based operating
|
||||
systems.
|
||||
|
||||
-DLIBOMP_ENABLE_SHARED=on|off
|
||||
Shared library instead of static library? (Note: static libraries are not
|
||||
supported on Windows). If LIBOMP_ENABLE_SHARED is off, then static OpenMP
|
||||
libraries will be built instead of dynamic ones.
|
||||
|
||||
-DLIBOMP_OMPT_SUPPORT=off|on
|
||||
Should OMPT support be included in the build? (Not supported on Windows)
|
||||
If LIBOMP_OMPT_SUPPORT is off, then both ompt_blame and ompt_trace are ignored.
|
||||
|
||||
-DLIBOMP_OMPT_BLAME=on|off
|
||||
Should OMPT blame functionality be included in the build?
|
||||
|
||||
-DLIBOMP_OMPT_TRACE=on|off
|
||||
Should OMPT trace functionality be included in the build?
|
||||
|
||||
-DLIBOMP_STATS=off|on
|
||||
Should include stats-gathering code be included in the build?
|
||||
|
||||
-DLIBOMP_USE_DEBUGGER=off|on
|
||||
Should the friendly debugger interface be included in the build?
|
||||
|
||||
-DLIBOMP_USE_HWLOC=off|on
|
||||
Should the Hwloc library be used for affinity?
|
||||
This option is not supported on Windows.
|
||||
http://www.open-mpi.org/projects/hwloc
|
||||
|
||||
-DLIBOMP_HWLOC_INSTALL_DIR=/path/to/hwloc/install/dir
|
||||
Default: /usr/local
|
||||
This option is only used if LIBOMP_USE_HWLOC is on.
|
||||
Specifies install location of Hwloc. The configuration system will look for
|
||||
hwloc.h in ${LIBOMP_HWLOC_INSTALL_DIR}/include and the library in
|
||||
${LIBOMP_HWLOC_INSTALL_DIR}/lib.
|
||||
|
||||
-DLIBOMP_LLVM_LIT_EXECUTABLE=/path/to/llvm-lit
|
||||
Default: search in PATH
|
||||
Specifiy full path to llvm-lit executable for running tests.
|
||||
|
||||
-DOPENMP_LLVM_TOOLS_DIR=/path/to/built/llvm/tools
|
||||
Default: search for tools in path
|
||||
Additional path to search for LLVM tools needed by tests.
|
||||
|
||||
================================
|
||||
How to append flags to the build
|
||||
================================
|
||||
- These flags are *appended*. They do not
|
||||
overwrite any of the preset flags.
|
||||
-DLIBOMP_CPPFLAGS=<space-separated flags> -- Additional C preprocessor flags
|
||||
-DLIBOMP_CFLAGS=<space-separated flags> -- Additional C compiler flags
|
||||
-DLIBOMP_CXXFLAGS=<space-separated flags> -- Additional C++ compiler flags
|
||||
-DLIBOMP_ASMFLAGS=<space-separated flags> -- Additional assembly flags
|
||||
-DLIBOMP_LDFLAGS=<space-separated flags> -- Additional linker flags
|
||||
-DLIBOMP_LIBFLAGS=<space-separated flags> -- Additional libraries to link
|
||||
-DLIBOMP_FFLAGS=<space-separated flags> -- Additional Fortran compiler flags
|
||||
|
||||
=======================
|
||||
Example usages of CMake
|
||||
=======================
|
||||
---- Typical usage ----
|
||||
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc ..
|
||||
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
|
||||
|
||||
---- With Various Options ----
|
||||
- Build the i386 Linux library using GCC*
|
||||
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_ARCH=i386 ..
|
||||
|
||||
- Build the x86_64 debug Mac library using Clang*
|
||||
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLIBOMP_ARCH=x86_64 -DCMAKE_BUILD_TYPE=Debug ..
|
||||
|
||||
- Build the library (architecture determined by probing compiler) using the
|
||||
Intel(R) C Compiler and the Intel(R) C++ Compiler. Also, create the fortran modules using
|
||||
the Intel(R) Fortran Compiler.
|
||||
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort -DLIBOMP_FORTRAN_MODULES=on ..
|
||||
|
||||
- Have CMake Find the C/C++ compiler, and specify additional flags for the C compiler, preprocessor, and C++ compiler.
|
||||
cmake -DLIBOMP_CFLAGS='-specific-flag' -DLIBOMP_CPPFLAGS='-DNEW_FEATURE=1 -DOLD_FEATURE=0' -DLIBOMP_CXXFLAGS='--one-specific-flag --two-specific-flag' ..
|
||||
|
||||
---- Build the stubs library ----
|
||||
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLIBOMP_LIB_TYPE=stubs ..
|
||||
|
||||
=========
|
||||
Footnotes
|
||||
=========
|
||||
[*] Other names and brands may be claimed as the property of others.
|
||||
+397
-5
@@ -1,8 +1,400 @@
|
||||
project(openmp)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
set(VERSION 5)
|
||||
set(OMP_VERSION "201107")
|
||||
set(OMP_VERSION_NUM "40")
|
||||
# CMAKE libomp
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
# Add cmake directory to search for custom cmake functions
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Standalone build or part of LLVM?
|
||||
set(LIBOMP_STANDALONE_BUILD FALSE)
|
||||
if(OPENMP_STANDALONE_BUILD OR
|
||||
"${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}" OR
|
||||
"${CMAKE_SOURCE_DIR}/runtime" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
project(libomp C CXX)
|
||||
set(LIBOMP_STANDALONE_BUILD TRUE)
|
||||
endif()
|
||||
|
||||
# Set libomp version
|
||||
set(LIBOMP_VERSION_MAJOR 5)
|
||||
set(LIBOMP_VERSION_MINOR 0)
|
||||
|
||||
# These include files are in the cmake/ subdirectory
|
||||
include(LibompUtils)
|
||||
include(LibompGetArchitecture)
|
||||
include(LibompHandleFlags)
|
||||
include(LibompDefinitions)
|
||||
|
||||
# Determine the target architecture
|
||||
if(${LIBOMP_STANDALONE_BUILD})
|
||||
# If adding a new architecture, take a look at cmake/LibompGetArchitecture.cmake
|
||||
libomp_get_architecture(LIBOMP_DETECTED_ARCH)
|
||||
set(LIBOMP_ARCH ${LIBOMP_DETECTED_ARCH} CACHE STRING
|
||||
"The architecture to build for (x86_64/i386/arm/ppc64/ppc64le/aarch64/mic/mips/mips64).")
|
||||
# Allow user to choose a suffix for the installation directory.
|
||||
set(LIBOMP_LIBDIR_SUFFIX "" CACHE STRING
|
||||
"suffix of lib installation directory e.g., 64 => lib64")
|
||||
# Should assertions be enabled? They are on by default.
|
||||
set(LIBOMP_ENABLE_ASSERTIONS TRUE CACHE BOOL
|
||||
"enable assertions?")
|
||||
set(LIBOMP_ENABLE_WERROR FALSE CACHE BOOL
|
||||
"Enable -Werror flags to turn warnings into errors for supporting compilers.")
|
||||
# CMAKE_BUILD_TYPE was not defined, set default to Release
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
else() # Part of LLVM build
|
||||
# Determine the native architecture from LLVM.
|
||||
string(TOLOWER "${LLVM_TARGET_ARCH}" LIBOMP_NATIVE_ARCH)
|
||||
if( LIBOMP_NATIVE_ARCH STREQUAL "host" )
|
||||
string(REGEX MATCH "^[^-]*" LIBOMP_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
|
||||
endif ()
|
||||
if(LIBOMP_NATIVE_ARCH MATCHES "i[2-6]86")
|
||||
set(LIBOMP_ARCH i386)
|
||||
elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86")
|
||||
set(LIBOMP_ARCH i386)
|
||||
elseif(LIBOMP_NATIVE_ARCH STREQUAL "amd64")
|
||||
set(LIBOMP_ARCH x86_64)
|
||||
elseif(LIBOMP_NATIVE_ARCH STREQUAL "x86_64")
|
||||
set(LIBOMP_ARCH x86_64)
|
||||
elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc64le")
|
||||
set(LIBOMP_ARCH ppc64le)
|
||||
elseif(LIBOMP_NATIVE_ARCH MATCHES "powerpc")
|
||||
set(LIBOMP_ARCH ppc64)
|
||||
elseif(LIBOMP_NATIVE_ARCH MATCHES "aarch64")
|
||||
set(LIBOMP_ARCH aarch64)
|
||||
elseif(LIBOMP_NATIVE_ARCH MATCHES "arm64")
|
||||
set(LIBOMP_ARCH aarch64)
|
||||
elseif(LIBOMP_NATIVE_ARCH MATCHES "arm")
|
||||
set(LIBOMP_ARCH arm)
|
||||
else()
|
||||
# last ditch effort
|
||||
libomp_get_architecture(LIBOMP_ARCH)
|
||||
endif ()
|
||||
set(LIBOMP_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})
|
||||
set(LIBOMP_ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS})
|
||||
set(LIBOMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
|
||||
endif()
|
||||
libomp_check_variable(LIBOMP_ARCH 32e x86_64 32 i386 arm ppc64 ppc64le aarch64 mic mips mips64)
|
||||
|
||||
set(LIBOMP_LIB_TYPE normal CACHE STRING
|
||||
"Performance,Profiling,Stubs library (normal/profile/stubs)")
|
||||
libomp_check_variable(LIBOMP_LIB_TYPE normal profile stubs)
|
||||
set(LIBOMP_OMP_VERSION 50 CACHE STRING
|
||||
"The OpenMP version (50/45/40/30)")
|
||||
libomp_check_variable(LIBOMP_OMP_VERSION 50 45 40 30)
|
||||
# Set the OpenMP Year and Month assiociated with version
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201611)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201511)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201307)
|
||||
elseif(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
|
||||
set(LIBOMP_OMP_YEAR_MONTH 201107)
|
||||
else()
|
||||
set(LIBOMP_OMP_YEAR_MONTH 200505)
|
||||
endif()
|
||||
set(LIBOMP_MIC_ARCH knc CACHE STRING
|
||||
"Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) (knf/knc). Ignored if not Intel(R) MIC Architecture build.")
|
||||
if("${LIBOMP_ARCH}" STREQUAL "mic")
|
||||
libomp_check_variable(LIBOMP_MIC_ARCH knf knc)
|
||||
endif()
|
||||
set(LIBOMP_FORTRAN_MODULES FALSE CACHE BOOL
|
||||
"Create Fortran module files? (requires fortran compiler)")
|
||||
|
||||
# - Support for universal fat binary builds on Mac
|
||||
# - Having this extra variable allows people to build this library as a universal library
|
||||
# without forcing a universal build of the llvm/clang compiler.
|
||||
set(LIBOMP_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}" CACHE STRING
|
||||
"For Mac builds, semicolon separated list of architectures to build for universal fat binary.")
|
||||
set(CMAKE_OSX_ARCHITECTURES ${LIBOMP_OSX_ARCHITECTURES})
|
||||
|
||||
# Should @rpath be used for dynamic libraries on Mac?
|
||||
# The if(NOT DEFINED) is there to guard a cached value of the variable if one
|
||||
# exists so there is no interference with what the user wants. Also, no cache entry
|
||||
# is created so there are no inadvertant effects on other parts of LLVM.
|
||||
if(NOT DEFINED CMAKE_MACOSX_RPATH)
|
||||
set(CMAKE_MACOSX_RPATH TRUE)
|
||||
endif()
|
||||
|
||||
# User specified flags. These are appended to the configured flags.
|
||||
set(LIBOMP_CFLAGS "" CACHE STRING
|
||||
"Appended user specified C compiler flags.")
|
||||
set(LIBOMP_CXXFLAGS "" CACHE STRING
|
||||
"Appended user specified C++ compiler flags.")
|
||||
set(LIBOMP_CPPFLAGS "" CACHE STRING
|
||||
"Appended user specified C preprocessor flags.")
|
||||
set(LIBOMP_ASMFLAGS "" CACHE STRING
|
||||
"Appended user specified assembler flags.")
|
||||
set(LIBOMP_LDFLAGS "" CACHE STRING
|
||||
"Appended user specified linker flags.")
|
||||
set(LIBOMP_LIBFLAGS "" CACHE STRING
|
||||
"Appended user specified linked libs flags. (e.g., -lm)")
|
||||
set(LIBOMP_FFLAGS "" CACHE STRING
|
||||
"Appended user specified Fortran compiler flags. These are only used if LIBOMP_FORTRAN_MODULES==TRUE.")
|
||||
|
||||
# Should the libomp library and generated headers be copied into the original source exports/ directory
|
||||
# Turning this to FALSE aids parallel builds to not interfere with each other.
|
||||
# Currently, the testsuite module expects the just built OpenMP library to be located inside the exports/
|
||||
# directory. TODO: have testsuite run under llvm-lit directly. We can then get rid of copying to exports/
|
||||
set(LIBOMP_COPY_EXPORTS TRUE CACHE STRING
|
||||
"Should exports be copied into source exports/ directory?")
|
||||
|
||||
# HWLOC-support
|
||||
set(LIBOMP_USE_HWLOC FALSE CACHE BOOL
|
||||
"Use Hwloc (http://www.open-mpi.org/projects/hwloc/) library for affinity?")
|
||||
set(LIBOMP_HWLOC_INSTALL_DIR /usr/local CACHE PATH
|
||||
"Install path for hwloc library")
|
||||
|
||||
# Get the build number from kmp_version.cpp
|
||||
libomp_get_build_number("${CMAKE_CURRENT_SOURCE_DIR}" LIBOMP_VERSION_BUILD)
|
||||
math(EXPR LIBOMP_VERSION_BUILD_YEAR "${LIBOMP_VERSION_BUILD}/10000")
|
||||
math(EXPR LIBOMP_VERSION_BUILD_MONTH_DAY "${LIBOMP_VERSION_BUILD}%10000")
|
||||
|
||||
# Currently don't record any timestamps
|
||||
set(LIBOMP_BUILD_DATE "No_Timestamp")
|
||||
|
||||
# Architecture
|
||||
set(IA32 FALSE)
|
||||
set(INTEL64 FALSE)
|
||||
set(ARM FALSE)
|
||||
set(AARCH64 FALSE)
|
||||
set(PPC64BE FALSE)
|
||||
set(PPC64LE FALSE)
|
||||
set(PPC64 FALSE)
|
||||
set(MIC FALSE)
|
||||
set(MIPS64 FALSE)
|
||||
set(MIPS FALSE)
|
||||
if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32") # IA-32 architecture
|
||||
set(IA32 TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
|
||||
set(INTEL64 TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "arm") # ARM architecture
|
||||
set(ARM TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "ppc64") # PPC64BE architecture
|
||||
set(PPC64BE TRUE)
|
||||
set(PPC64 TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "ppc64le") # PPC64LE architecture
|
||||
set(PPC64LE TRUE)
|
||||
set(PPC64 TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "aarch64") # AARCH64 architecture
|
||||
set(AARCH64 TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "mic") # Intel(R) Many Integrated Core Architecture
|
||||
set(MIC TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "mips") # MIPS architecture
|
||||
set(MIPS TRUE)
|
||||
elseif("${LIBOMP_ARCH}" STREQUAL "mips64") # MIPS64 architecture
|
||||
set(MIPS64 TRUE)
|
||||
endif()
|
||||
|
||||
# Set some flags based on build_type
|
||||
set(RELEASE_BUILD FALSE)
|
||||
set(DEBUG_BUILD FALSE)
|
||||
set(RELWITHDEBINFO_BUILD FALSE)
|
||||
set(MINSIZEREL_BUILD FALSE)
|
||||
string(TOLOWER "${CMAKE_BUILD_TYPE}" libomp_build_type_lowercase)
|
||||
if("${libomp_build_type_lowercase}" STREQUAL "release")
|
||||
set(RELEASE_BUILD TRUE)
|
||||
elseif("${libomp_build_type_lowercase}" STREQUAL "debug")
|
||||
set(DEBUG_BUILD TRUE)
|
||||
elseif("${libomp_build_type_lowercase}" STREQUAL "relwithdebinfo")
|
||||
set(RELWITHDEBINFO_BUILD TRUE)
|
||||
elseif("${libomp_build_type_lowercase}" STREQUAL "minsizerel")
|
||||
set(MINSIZEREL_BUILD TRUE)
|
||||
endif()
|
||||
|
||||
# Include itt notify interface?
|
||||
set(LIBOMP_USE_ITT_NOTIFY TRUE CACHE BOOL
|
||||
"Enable ITT notify?")
|
||||
|
||||
# normal, profile, stubs library.
|
||||
set(NORMAL_LIBRARY FALSE)
|
||||
set(STUBS_LIBRARY FALSE)
|
||||
set(PROFILE_LIBRARY FALSE)
|
||||
if("${LIBOMP_LIB_TYPE}" STREQUAL "normal")
|
||||
set(NORMAL_LIBRARY TRUE)
|
||||
elseif("${LIBOMP_LIB_TYPE}" STREQUAL "profile")
|
||||
set(PROFILE_LIBRARY TRUE)
|
||||
elseif("${LIBOMP_LIB_TYPE}" STREQUAL "stubs")
|
||||
set(STUBS_LIBRARY TRUE)
|
||||
endif()
|
||||
|
||||
# Setting directory names
|
||||
set(LIBOMP_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(LIBOMP_SRC_DIR ${LIBOMP_BASE_DIR}/src)
|
||||
set(LIBOMP_TOOLS_DIR ${LIBOMP_BASE_DIR}/tools)
|
||||
set(LIBOMP_INC_DIR ${LIBOMP_SRC_DIR}/include/${LIBOMP_OMP_VERSION})
|
||||
set(LIBOMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
# Enabling Fortran if it is needed
|
||||
if(${LIBOMP_FORTRAN_MODULES})
|
||||
enable_language(Fortran)
|
||||
endif()
|
||||
# Enable MASM Compiler if it is needed (Windows only)
|
||||
if(WIN32)
|
||||
enable_language(ASM_MASM)
|
||||
endif()
|
||||
|
||||
# Getting legal type/arch
|
||||
libomp_get_legal_type(LIBOMP_LEGAL_TYPE)
|
||||
libomp_get_legal_arch(LIBOMP_LEGAL_ARCH)
|
||||
|
||||
# Compiler flag checks, library checks, threading check, etc.
|
||||
include(config-ix)
|
||||
|
||||
# Is there a quad precision data type available?
|
||||
# TODO: Make this a real feature check
|
||||
set(LIBOMP_USE_QUAD_PRECISION "${LIBOMP_HAVE_QUAD_PRECISION}" CACHE BOOL
|
||||
"Should 128-bit precision entry points be built?")
|
||||
if(LIBOMP_USE_QUAD_PRECISION AND (NOT LIBOMP_HAVE_QUAD_PRECISION))
|
||||
libomp_error_say("128-bit quad precision functionality requested but not available")
|
||||
endif()
|
||||
|
||||
# libgomp drop-in compatibility requires versioned symbols
|
||||
set(LIBOMP_USE_VERSION_SYMBOLS "${LIBOMP_HAVE_VERSION_SYMBOLS}" CACHE BOOL
|
||||
"Should version symbols be used? These provide binary compatibility with libgomp.")
|
||||
if(LIBOMP_USE_VERSION_SYMBOLS AND (NOT LIBOMP_HAVE_VERSION_SYMBOLS))
|
||||
libomp_error_say("Version symbols functionality requested but not available")
|
||||
endif()
|
||||
|
||||
# On multinode systems, larger alignment is desired to avoid false sharing
|
||||
set(LIBOMP_USE_INTERNODE_ALIGNMENT FALSE CACHE BOOL
|
||||
"Should larger alignment (4096 bytes) be used for some locks and data structures?")
|
||||
|
||||
# Build code that allows the OpenMP library to conveniently interface with debuggers
|
||||
set(LIBOMP_USE_DEBUGGER FALSE CACHE BOOL
|
||||
"Enable debugger interface code?")
|
||||
|
||||
# Should we link to C++ library?
|
||||
set(LIBOMP_USE_STDCPPLIB FALSE CACHE BOOL
|
||||
"Should we link to C++ library?")
|
||||
|
||||
# TSX (x86) based locks have __asm code which can be troublesome for some compilers.
|
||||
# TODO: Make this a real feature check
|
||||
set(LIBOMP_USE_ADAPTIVE_LOCKS "${LIBOMP_HAVE_ADAPTIVE_LOCKS}" CACHE BOOL
|
||||
"Should TSX-based lock be compiled (adaptive lock in kmp_lock.cpp). These are x86 specific.")
|
||||
if(LIBOMP_USE_ADAPTIVE_LOCKS AND (NOT LIBOMP_HAVE_ADAPTIVE_LOCKS))
|
||||
libomp_error_say("Adaptive locks (TSX) functionality requested but not available")
|
||||
endif()
|
||||
|
||||
# - stats-gathering enables OpenMP stats where things like the number of
|
||||
# parallel regions, clock ticks spent in particular openmp regions are recorded.
|
||||
set(LIBOMP_STATS FALSE CACHE BOOL
|
||||
"Stats-Gathering functionality?")
|
||||
if(LIBOMP_STATS AND (NOT LIBOMP_HAVE_STATS))
|
||||
libomp_error_say("Stats-gathering functionality requested but not available")
|
||||
endif()
|
||||
# The stats functionality requires the std c++ library
|
||||
if(LIBOMP_STATS)
|
||||
set(LIBOMP_USE_STDCPPLIB TRUE)
|
||||
endif()
|
||||
|
||||
# Shared library can be switched to a static library
|
||||
set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL
|
||||
"Shared library instead of static library?")
|
||||
|
||||
if(WIN32 AND NOT LIBOMP_ENABLE_SHARED)
|
||||
libomp_error_say("Static libraries requested but not available on Windows")
|
||||
endif()
|
||||
|
||||
if(LIBOMP_USE_ITT_NOTIFY AND NOT LIBOMP_ENABLE_SHARED)
|
||||
message(STATUS "ITT Notify not supported for static libraries - forcing ITT Notify off")
|
||||
set(LIBOMP_USE_ITT_NOTIFY FALSE)
|
||||
endif()
|
||||
|
||||
# OMPT-support
|
||||
set(LIBOMP_OMPT_DEBUG FALSE CACHE BOOL
|
||||
"Trace OMPT initialization?")
|
||||
set(LIBOMP_OMPT_SUPPORT FALSE CACHE BOOL
|
||||
"OMPT-support?")
|
||||
set(LIBOMP_OMPT_BLAME TRUE CACHE BOOL
|
||||
"OMPT-blame?")
|
||||
set(LIBOMP_OMPT_TRACE TRUE CACHE BOOL
|
||||
"OMPT-trace?")
|
||||
if(LIBOMP_OMPT_SUPPORT AND (NOT LIBOMP_HAVE_OMPT_SUPPORT))
|
||||
libomp_error_say("OpenMP Tools Interface requested but not available")
|
||||
endif()
|
||||
|
||||
# TSAN-support
|
||||
set(LIBOMP_TSAN_SUPPORT FALSE CACHE BOOL
|
||||
"TSAN-support?")
|
||||
if(LIBOMP_TSAN_SUPPORT AND (NOT LIBOMP_HAVE_TSAN_SUPPORT))
|
||||
libomp_error_say("TSAN functionality requested but not available")
|
||||
endif()
|
||||
|
||||
# Error check hwloc support after config-ix has run
|
||||
if(LIBOMP_USE_HWLOC AND (NOT LIBOMP_HAVE_HWLOC))
|
||||
libomp_error_say("Hwloc requested but not available")
|
||||
endif()
|
||||
|
||||
# Setting final library name
|
||||
set(LIBOMP_DEFAULT_LIB_NAME libomp)
|
||||
if(${PROFILE_LIBRARY})
|
||||
set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}prof)
|
||||
endif()
|
||||
if(${STUBS_LIBRARY})
|
||||
set(LIBOMP_DEFAULT_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME}stubs)
|
||||
endif()
|
||||
set(LIBOMP_LIB_NAME ${LIBOMP_DEFAULT_LIB_NAME} CACHE STRING "Base OMP library name")
|
||||
|
||||
if(${LIBOMP_ENABLE_SHARED})
|
||||
set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(LIBOMP_LIBRARY_KIND SHARED)
|
||||
set(LIBOMP_INSTALL_KIND LIBRARY)
|
||||
else()
|
||||
set(LIBOMP_LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(LIBOMP_LIBRARY_KIND STATIC)
|
||||
set(LIBOMP_INSTALL_KIND ARCHIVE)
|
||||
endif()
|
||||
|
||||
set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX})
|
||||
|
||||
# Optional backwards compatibility aliases.
|
||||
set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL
|
||||
"Install libgomp and libiomp5 library aliases for backwards compatibility")
|
||||
|
||||
# Print configuration after all variables are set.
|
||||
if(${LIBOMP_STANDALONE_BUILD})
|
||||
libomp_say("Operating System -- ${CMAKE_SYSTEM_NAME}")
|
||||
libomp_say("Target Architecture -- ${LIBOMP_ARCH}")
|
||||
if(${MIC})
|
||||
libomp_say("Intel(R) MIC Architecture -- ${LIBOMP_MIC_ARCH}")
|
||||
endif()
|
||||
libomp_say("Build Type -- ${CMAKE_BUILD_TYPE}")
|
||||
libomp_say("OpenMP Version -- ${LIBOMP_OMP_VERSION}")
|
||||
libomp_say("Library Kind -- ${LIBOMP_LIBRARY_KIND}")
|
||||
libomp_say("Library Type -- ${LIBOMP_LIB_TYPE}")
|
||||
libomp_say("Fortran Modules -- ${LIBOMP_FORTRAN_MODULES}")
|
||||
# will say development if all zeros
|
||||
if(${LIBOMP_VERSION_BUILD} STREQUAL 00000000)
|
||||
set(LIBOMP_BUILD Development)
|
||||
else()
|
||||
set(LIBOMP_BUILD ${LIBOMP_VERSION_BUILD})
|
||||
endif()
|
||||
libomp_say("Build -- ${LIBOMP_BUILD}")
|
||||
libomp_say("Use Stats-gathering -- ${LIBOMP_STATS}")
|
||||
libomp_say("Use Debugger-support -- ${LIBOMP_USE_DEBUGGER}")
|
||||
libomp_say("Use ITT notify -- ${LIBOMP_USE_ITT_NOTIFY}")
|
||||
libomp_say("Use OMPT-support -- ${LIBOMP_OMPT_SUPPORT}")
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
libomp_say("Use OMPT-blame -- ${LIBOMP_OMPT_BLAME}")
|
||||
libomp_say("Use OMPT-trace -- ${LIBOMP_OMPT_TRACE}")
|
||||
endif()
|
||||
libomp_say("Use Adaptive locks -- ${LIBOMP_USE_ADAPTIVE_LOCKS}")
|
||||
libomp_say("Use quad precision -- ${LIBOMP_USE_QUAD_PRECISION}")
|
||||
libomp_say("Use TSAN-support -- ${LIBOMP_TSAN_SUPPORT}")
|
||||
libomp_say("Use Hwloc library -- ${LIBOMP_USE_HWLOC}")
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(test)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
omp_root?=.
|
||||
include $(omp_root)/tools/common.inc
|
||||
.PHONY: default all omp
|
||||
|
||||
default: omp
|
||||
|
||||
all: omp stubs
|
||||
|
||||
omp: info mkdir
|
||||
@echo $(omp_root)/tools/build.pl $(build_args) --arch=$(arch) --mode=$(mode) lib inc common
|
||||
$(omp_root)/tools/build.pl $(build_args) --arch=$(arch) --mode=$(mode) lib inc common
|
||||
|
||||
stubs: mkdir
|
||||
@echo $(omp_root)/tools/build.pl $(build_args) --arch=$(arch) --mode=$(mode) --stubs lib inc common
|
||||
$(omp_root)/tools/build.pl $(build_args) --arch=$(arch) --mode=$(mode) --stubs lib inc common
|
||||
|
||||
.PHONY: clean info
|
||||
|
||||
clean:
|
||||
$(shell $(RM) -rf $(omp_root)$(SLASH)tmp)
|
||||
@echo clean done
|
||||
|
||||
mkdir:
|
||||
$(shell $(MD) $(omp_root)$(SLASH)tmp >$(NUL) 2>$(NUL))
|
||||
@echo Created $(omp_root)$(SLASH)tmp directory
|
||||
|
||||
info:
|
||||
@echo omp_root=$(omp_root)
|
||||
@echo omp_os=$(omp_os)
|
||||
@echo arch=$(arch)
|
||||
@echo compiler=$(compiler)
|
||||
@echo mic=$(mic)
|
||||
@echo mode=$(mode)
|
||||
|
||||
+64
-65
@@ -1,17 +1,17 @@
|
||||
|
||||
README for Intel(R) OpenMP* Runtime Library
|
||||
===========================================
|
||||
README for the LLVM* OpenMP* Runtime Library
|
||||
============================================
|
||||
|
||||
How to Build Documentation
|
||||
==========================
|
||||
|
||||
The main documentation is in Doxygen* format, and this distribution
|
||||
should come with pre-built PDF documentation in doc/Reference.pdf.
|
||||
should come with pre-built PDF documentation in doc/Reference.pdf.
|
||||
However, an HTML version can be built by executing:
|
||||
|
||||
% doxygen doc/doxygen/config
|
||||
% doxygen doc/doxygen/config
|
||||
|
||||
in this directory.
|
||||
in the runtime directory.
|
||||
|
||||
That will produce HTML documentation in the doc/doxygen/generated
|
||||
directory, which can be accessed by pointing a web browser at the
|
||||
@@ -21,93 +21,92 @@ If you don't have Doxygen installed, you can download it from
|
||||
www.doxygen.org.
|
||||
|
||||
|
||||
How to Build the Intel(R) OpenMP* Runtime Library
|
||||
=================================================
|
||||
How to Build the LLVM* OpenMP* Runtime Library
|
||||
==============================================
|
||||
In-tree build:
|
||||
|
||||
The Makefile at the top-level will attempt to detect what it needs to
|
||||
build the Intel(R) OpenMP* Runtime Library. To see the default settings,
|
||||
type:
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp into llvm/projects
|
||||
$ cd where-you-want-to-build
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/llvm -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make omp
|
||||
|
||||
make info
|
||||
Out-of-tree build:
|
||||
|
||||
You can change the Makefile's behavior with the following options:
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp
|
||||
$ cd where-you-want-to-live/openmp/runtime
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/openmp -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make
|
||||
|
||||
omp_root: The path to the top-level directory containing the top-level
|
||||
Makefile. By default, this will take on the value of the
|
||||
current working directory.
|
||||
For details about building, please look at Build_With_CMake.txt
|
||||
|
||||
omp_os: Operating system. By default, the build will attempt to
|
||||
detect this. Currently supports "linux", "freebsd", "macos", and
|
||||
"windows".
|
||||
|
||||
arch: Architecture. By default, the build will attempt to
|
||||
detect this if not specified by the user. Currently
|
||||
supported values are
|
||||
"32" for IA-32 architecture
|
||||
"32e" for Intel(R) 64 architecture
|
||||
"mic" for Intel(R) Many Integrated Core Architecture
|
||||
|
||||
If "mic" is specified then "icc" will be used as the
|
||||
compiler, and appropriate k1om binutils will be used. The
|
||||
necessary packages must be installed on the build machine
|
||||
for this to be possible (but an Intel(R) Xeon Phi(TM)
|
||||
coprocessor card is not required to build the library).
|
||||
|
||||
compiler: Which compiler to use for the build. Defaults to "icc"
|
||||
or "icl" depending on the value of omp_os. Also supports
|
||||
some versions of "gcc"* when omp_os is "linux". The selected
|
||||
compiler should be installed and in the user's path. The
|
||||
corresponding Fortran compiler should also be in the path.
|
||||
See "Supported RTL Build Configurations" below for more
|
||||
information on compiler versions.
|
||||
|
||||
mode: Library mode: default is "release". Also supports "debug".
|
||||
|
||||
To use any of the options above, simple add <option_name>=<value>. For
|
||||
example, if you want to build with gcc instead of icc, type:
|
||||
|
||||
make compiler=gcc
|
||||
|
||||
There is also an experimental CMake build system. This is *not* yet
|
||||
supported for production use and resulting binaries have not been checked
|
||||
for compatibility.
|
||||
Architectures Supported
|
||||
=======================
|
||||
* IA-32 architecture
|
||||
* Intel(R) 64 architecture
|
||||
* Intel(R) Many Integrated Core Architecture
|
||||
* ARM* architecture
|
||||
* Aarch64 (64-bit ARM) architecture
|
||||
* IBM(R) Power architecture (big endian)
|
||||
* IBM(R) Power architecture (little endian)
|
||||
* MIPS and MIPS64 architecture
|
||||
|
||||
Supported RTL Build Configurations
|
||||
==================================
|
||||
|
||||
Supported Architectures: IA-32 architecture, Intel(R) 64, and
|
||||
Supported Architectures: IA-32 architecture, Intel(R) 64, and
|
||||
Intel(R) Many Integrated Core Architecture
|
||||
|
||||
--------------------------------------------
|
||||
| icc/icl | gcc | clang |
|
||||
--------------|---------------|--------------------------|
|
||||
| Linux* OS | Yes(1,5) | Yes(2,4) | Yes(4,6,7) |
|
||||
| FreeBSD* | No | No | Yes(4,6,7) |
|
||||
| OS X* | Yes(1,3,4) | No | Yes(4,6,7) |
|
||||
| Windows* OS | Yes(1,4) | No | No |
|
||||
----------------------------------------------------------
|
||||
----------------------------------------------
|
||||
| icc/icl | gcc | clang |
|
||||
--------------|---------------|----------------------------|
|
||||
| Linux* OS | Yes(1,5) | Yes(2,4) | Yes(4,6,7) |
|
||||
| FreeBSD* | No | No | Yes(4,6,7,8) |
|
||||
| OS X* | Yes(1,3,4) | No | Yes(4,6,7) |
|
||||
| Windows* OS | Yes(1,4) | No | No |
|
||||
------------------------------------------------------------
|
||||
|
||||
(1) On IA-32 architecture and Intel(R) 64, icc/icl versions 12.x are
|
||||
(1) On IA-32 architecture and Intel(R) 64, icc/icl versions 12.x are
|
||||
supported (12.1 is recommended).
|
||||
(2) gcc version 4.6.2 is supported.
|
||||
(2) GCC* version 4.7 is supported.
|
||||
(3) For icc on OS X*, OS X* version 10.5.8 is supported.
|
||||
(4) Intel(R) Many Integrated Core Architecture not supported.
|
||||
(5) On Intel(R) Many Integrated Core Architecture, icc/icl versions 13.0
|
||||
(5) On Intel(R) Many Integrated Core Architecture, icc/icl versions 13.0
|
||||
or later are required.
|
||||
(6) clang version 3.3 is supported.
|
||||
(7) clang currently does not offer a software-implemented 128 bit extended
|
||||
(6) Clang* version 3.3 is supported.
|
||||
(7) Clang* currently does not offer a software-implemented 128 bit extended
|
||||
precision type. Thus, all entry points reliant on this type are removed
|
||||
from the library and cannot be called in the user program. The following
|
||||
functions are not available:
|
||||
__kmpc_atomic_cmplx16_*
|
||||
__kmpc_atomic_float16_*
|
||||
__kmpc_atomic_*_fp
|
||||
(8) Community contribution provided AS IS, not tested by Intel.
|
||||
|
||||
Supported Architectures: IBM(R) Power 7 and Power 8
|
||||
|
||||
-----------------------------
|
||||
| gcc | clang |
|
||||
--------------|------------|--------------|
|
||||
| Linux* OS | Yes(1,2) | Yes(3,4) |
|
||||
-------------------------------------------
|
||||
|
||||
(1) On Power 7, gcc version 4.8.2 is supported.
|
||||
(2) On Power 8, gcc version 4.8.2 is supported.
|
||||
(3) On Power 7, clang version 3.7 is supported.
|
||||
(4) On Power 8, clang version 3.7 is supported.
|
||||
|
||||
|
||||
Front-end Compilers that work with this RTL
|
||||
===========================================
|
||||
|
||||
The following compilers are known to do compatible code generation for
|
||||
this RTL: icc/icl, gcc. See the documentation for more detail.
|
||||
this RTL: clang (from the OpenMP development branch at
|
||||
http://clang-omp.github.io/ ), Intel compilers, GCC. See the documentation
|
||||
for more details.
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# Checking a fortran compiler flag
|
||||
# There is no real trivial way to do this in CMake, so we implement it here
|
||||
# this will have ${boolean} = TRUE if the flag succeeds, otherwise false.
|
||||
function(libomp_check_fortran_flag flag boolean)
|
||||
if(NOT DEFINED "${boolean}")
|
||||
set(retval TRUE)
|
||||
set(fortran_source
|
||||
" program hello
|
||||
print *, \"Hello World!\"
|
||||
end program hello")
|
||||
|
||||
set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping")
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.1 OR CMAKE_VERSION VERSION_EQUAL 3.1)
|
||||
include(CheckFortranSourceCompiles)
|
||||
check_fortran_source_compiles("${fortran_source}" ${boolean} FAIL_REGEX "${failed_regexes}")
|
||||
set(${boolean} ${${boolean}} PARENT_SCOPE)
|
||||
return()
|
||||
else()
|
||||
# Our manual check for cmake versions that don't have CheckFortranSourceCompiles
|
||||
set(base_dir ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/fortran_flag_check)
|
||||
file(MAKE_DIRECTORY ${base_dir})
|
||||
file(WRITE ${base_dir}/fortran_source.f "${fortran_source}")
|
||||
|
||||
message(STATUS "Performing Test ${boolean}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_Fortran_COMPILER} "${flag}" ${base_dir}/fortran_source.f
|
||||
WORKING_DIRECTORY ${base_dir}
|
||||
RESULT_VARIABLE exit_code
|
||||
OUTPUT_VARIABLE OUTPUT
|
||||
ERROR_VARIABLE OUTPUT
|
||||
)
|
||||
|
||||
if(${exit_code} EQUAL 0)
|
||||
foreach(regex IN LISTS failed_regexes)
|
||||
if("${OUTPUT}" MATCHES ${regex})
|
||||
set(retval FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
set(retval FALSE)
|
||||
endif()
|
||||
|
||||
if(${retval})
|
||||
set(${boolean} 1 CACHE INTERNAL "Test ${boolean}")
|
||||
message(STATUS "Performing Test ${boolean} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing Fortran Compiler Flag test ${boolean} succeeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${fortran_source}\n")
|
||||
else()
|
||||
set(${boolean} "" CACHE INTERNAL "Test ${boolean}")
|
||||
message(STATUS "Performing Test ${boolean} - Failed")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing Fortran Compiler Flag test ${boolean} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${fortran_source}\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(${boolean} ${retval} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,68 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# Checking a linker flag to build a shared library
|
||||
# There is no real trivial way to do this in CMake, so we implement it here
|
||||
# this will have ${boolean} = TRUE if the flag succeeds, otherwise FALSE.
|
||||
function(libomp_check_linker_flag flag boolean)
|
||||
if(NOT DEFINED "${boolean}")
|
||||
set(retval TRUE)
|
||||
set(library_source
|
||||
"int foo(int a) { return a*a; }")
|
||||
set(cmake_source
|
||||
"cmake_minimum_required(VERSION 2.8)
|
||||
project(foo C)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS \"${flag}\")
|
||||
add_library(foo SHARED src_to_link.c)")
|
||||
set(failed_regexes "[Ee]rror;[Uu]nknown;[Ss]kipping;LINK : warning")
|
||||
set(base_dir ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/link_flag_check_${boolean})
|
||||
file(MAKE_DIRECTORY ${base_dir})
|
||||
file(MAKE_DIRECTORY ${base_dir}/build)
|
||||
file(WRITE ${base_dir}/src_to_link.c "${library_source}")
|
||||
file(WRITE ${base_dir}/CMakeLists.txt "${cmake_source}")
|
||||
|
||||
message(STATUS "Performing Test ${boolean}")
|
||||
try_compile(
|
||||
try_compile_result
|
||||
${base_dir}/build
|
||||
${base_dir}
|
||||
foo
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
if(try_compile_result)
|
||||
foreach(regex IN LISTS failed_regexes)
|
||||
if("${OUTPUT}" MATCHES ${regex})
|
||||
set(retval FALSE)
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
set(retval FALSE)
|
||||
endif()
|
||||
|
||||
if(${retval})
|
||||
set(${boolean} 1 CACHE INTERNAL "Test ${boolean}")
|
||||
message(STATUS "Performing Test ${boolean} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C Linker Flag test ${boolean} succeeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${library_source}\n")
|
||||
else()
|
||||
set(${boolean} "" CACHE INTERNAL "Test ${boolean}")
|
||||
message(STATUS "Performing Test ${boolean} - Failed")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C Linker Flag test ${boolean} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${library_source}\n")
|
||||
endif()
|
||||
|
||||
set(${boolean} ${retval} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
function(libomp_get_definitions_flags cppflags)
|
||||
set(cppflags_local)
|
||||
|
||||
if(WIN32)
|
||||
libomp_append(cppflags_local "-D _CRT_SECURE_NO_WARNINGS")
|
||||
libomp_append(cppflags_local "-D _CRT_SECURE_NO_DEPRECATE")
|
||||
libomp_append(cppflags_local "-D _WINDOWS")
|
||||
libomp_append(cppflags_local "-D _WINNT")
|
||||
libomp_append(cppflags_local "-D _WIN32_WINNT=0x0501")
|
||||
libomp_append(cppflags_local "-D _USRDLL")
|
||||
libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD)
|
||||
libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD)
|
||||
else()
|
||||
libomp_append(cppflags_local "-D _GNU_SOURCE")
|
||||
libomp_append(cppflags_local "-D _REENTRANT")
|
||||
endif()
|
||||
|
||||
# CMake doesn't include CPPFLAGS from environment, but we will.
|
||||
set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# LibompExports.cmake
|
||||
# Copy library and header files into the exports/ subdirectory after library build
|
||||
|
||||
# Create the suffix for the export directory
|
||||
# - Only add to suffix when not a default value
|
||||
# - Example suffix: .deb.30.s1
|
||||
# final export directory: exports/lin_32e.deb.30.s1/lib
|
||||
# - These suffixes imply the build is a Debug, OpenMP 3.0, Stats-Gathering version of the library
|
||||
set(libomp_suffix)
|
||||
libomp_append(libomp_suffix .deb DEBUG_BUILD)
|
||||
libomp_append(libomp_suffix .dia RELWITHDEBINFO_BUILD)
|
||||
libomp_append(libomp_suffix .min MINSIZEREL_BUILD)
|
||||
if(NOT "${LIBOMP_OMP_VERSION}" STREQUAL "45")
|
||||
libomp_append(libomp_suffix .${LIBOMP_OMP_VERSION})
|
||||
endif()
|
||||
libomp_append(libomp_suffix .s1 LIBOMP_STATS)
|
||||
libomp_append(libomp_suffix .ompt LIBOMP_OMPT_SUPPORT)
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
libomp_append(libomp_suffix .no-ompt-blame IF_FALSE LIBOMP_OMPT_BLAME)
|
||||
libomp_append(libomp_suffix .no-ompt-trace IF_FALSE LIBOMP_OMPT_TRACE)
|
||||
endif()
|
||||
string(REPLACE ";" "" libomp_suffix "${libomp_suffix}")
|
||||
|
||||
# Set exports locations
|
||||
if(${MIC})
|
||||
set(libomp_platform "${LIBOMP_PERL_SCRIPT_OS}_${LIBOMP_MIC_ARCH}") # e.g., lin_knf, lin_knc
|
||||
else()
|
||||
if(${IA32})
|
||||
set(libomp_platform "${LIBOMP_PERL_SCRIPT_OS}_32")
|
||||
elseif(${INTEL64})
|
||||
set(libomp_platform "${LIBOMP_PERL_SCRIPT_OS}_32e")
|
||||
else()
|
||||
set(libomp_platform "${LIBOMP_PERL_SCRIPT_OS}_${LIBOMP_ARCH}") # e.g., lin_arm, lin_ppc64
|
||||
endif()
|
||||
endif()
|
||||
set(LIBOMP_EXPORTS_DIR "${LIBOMP_BASE_DIR}/exports")
|
||||
set(LIBOMP_EXPORTS_PLATFORM_DIR "${LIBOMP_EXPORTS_DIR}/${libomp_platform}${libomp_suffix}")
|
||||
set(LIBOMP_EXPORTS_CMN_DIR "${LIBOMP_EXPORTS_DIR}/common${libomp_suffix}/include")
|
||||
set(LIBOMP_EXPORTS_INC_DIR "${LIBOMP_EXPORTS_PLATFORM_DIR}/include")
|
||||
set(LIBOMP_EXPORTS_MOD_DIR "${LIBOMP_EXPORTS_PLATFORM_DIR}/include_compat")
|
||||
set(LIBOMP_EXPORTS_LIB_DIR "${LIBOMP_EXPORTS_DIR}/${libomp_platform}${libomp_suffix}/lib")
|
||||
|
||||
# Put headers in exports/ directory post build
|
||||
add_custom_command(TARGET omp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_CMN_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy omp.h ${LIBOMP_EXPORTS_CMN_DIR}
|
||||
)
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
add_custom_command(TARGET omp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ompt.h ${LIBOMP_EXPORTS_CMN_DIR}
|
||||
)
|
||||
endif()
|
||||
if(${LIBOMP_FORTRAN_MODULES})
|
||||
add_custom_command(TARGET libomp-mod POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_MOD_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy omp_lib.mod ${LIBOMP_EXPORTS_MOD_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy omp_lib_kinds.mod ${LIBOMP_EXPORTS_MOD_DIR}
|
||||
)
|
||||
add_custom_command(TARGET omp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy omp_lib.h ${LIBOMP_EXPORTS_CMN_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Copy OpenMP library into exports/ directory post build
|
||||
if(WIN32)
|
||||
get_target_property(LIBOMP_OUTPUT_DIRECTORY omp RUNTIME_OUTPUT_DIRECTORY)
|
||||
else()
|
||||
get_target_property(LIBOMP_OUTPUT_DIRECTORY omp LIBRARY_OUTPUT_DIRECTORY)
|
||||
endif()
|
||||
if(NOT LIBOMP_OUTPUT_DIRECTORY)
|
||||
set(LIBOMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
add_custom_command(TARGET omp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_LIB_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR}
|
||||
)
|
||||
|
||||
# Copy Windows import library into exports/ directory post build
|
||||
if(WIN32)
|
||||
get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if(NOT LIBOMPIMP_OUTPUT_DIRECTORY)
|
||||
set(LIBOMPIMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
add_custom_command(TARGET ompimp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBOMP_EXPORTS_LIB_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE} ${LIBOMP_EXPORTS_LIB_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# Determine the architecture from predefined compiler macros
|
||||
# The architecture name can only contain alphanumeric characters and underscores (i.e., C identifier)
|
||||
|
||||
# void get_architecture(string* return_arch)
|
||||
# - Returns the architecture in return_arch
|
||||
function(libomp_get_architecture return_arch)
|
||||
set(detect_arch_src_txt "
|
||||
#if defined(__KNC__)
|
||||
#error ARCHITECTURE=mic
|
||||
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
|
||||
#error ARCHITECTURE=x86_64
|
||||
#elif defined(__i386) || defined(__i386__) || defined(__IA32__) || defined(_M_I86) || defined(_M_IX86) || defined(__X86__) || defined(_X86_)
|
||||
#error ARCHITECTURE=i386
|
||||
#elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6ZK__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__ARM_ARCH_2__)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__arm__) || defined(_M_ARM) || defined(_ARM)
|
||||
#error ARCHITECTURE=arm
|
||||
#elif defined(__aarch64__)
|
||||
#error ARCHITECTURE=aarch64
|
||||
#elif defined(__powerpc64__) && defined(__LITTLE_ENDIAN__)
|
||||
#error ARCHITECTURE=ppc64le
|
||||
#elif defined(__powerpc64__)
|
||||
#error ARCHITECTURE=ppc64
|
||||
#elif defined(__mips__) && defined(__mips64)
|
||||
#error ARCHITECTURE=mips64
|
||||
#elif defined(__mips__) && !defined(__mips64)
|
||||
#error ARCHITECTURE=mips
|
||||
#else
|
||||
#error ARCHITECTURE=UnknownArchitecture
|
||||
#endif
|
||||
")
|
||||
# Write out ${detect_arch_src_txt} to a file within the cmake/ subdirectory
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libomp_detect_arch.c" ${detect_arch_src_txt})
|
||||
|
||||
# Try to compile using the C Compiler. It will always error out with an #error directive, so store error output to ${local_architecture}
|
||||
try_run(run_dummy compile_dummy "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/libomp_detect_arch.c" COMPILE_OUTPUT_VARIABLE local_architecture)
|
||||
|
||||
# Match the important architecture line and store only that matching string in ${local_architecture}
|
||||
string(REGEX MATCH "ARCHITECTURE=([a-zA-Z0-9_]+)" local_architecture "${local_architecture}")
|
||||
|
||||
# Get rid of the ARCHITECTURE= part of the string
|
||||
string(REPLACE "ARCHITECTURE=" "" local_architecture "${local_architecture}")
|
||||
|
||||
# set the return value to the architecture detected (e.g., 32e, 32, arm, ppc64, etc.)
|
||||
set(${return_arch} "${local_architecture}" PARENT_SCOPE)
|
||||
|
||||
# Remove ${detect_arch_src_txt} from cmake/ subdirectory
|
||||
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/libomp_detect_arch.c")
|
||||
endfunction()
|
||||
@@ -0,0 +1,211 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# Setup the flags correctly for cmake (covert to string)
|
||||
# Pretty them up (STRIP any beginning and trailing whitespace,
|
||||
# remove duplicates, remove empty entries)
|
||||
macro(libomp_setup_flags flags)
|
||||
if(NOT "${${flags}}" STREQUAL "") # if flags are empty, don't do anything
|
||||
set(flags_local)
|
||||
list(REMOVE_DUPLICATES ${flags}) # remove duplicates
|
||||
list(REMOVE_ITEM ${flags} "") # remove empty items
|
||||
libomp_list_to_string("${${flags}}" flags_local)
|
||||
string(STRIP "${flags_local}" flags_local)
|
||||
set(${flags} "${flags_local}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Gets flags common to both the C and C++ compiler
|
||||
function(libomp_get_c_and_cxxflags_common flags)
|
||||
set(flags_local)
|
||||
libomp_append(flags_local -std=c++11 LIBOMP_HAVE_STD_CPP11_FLAG)
|
||||
libomp_append(flags_local -fno-exceptions LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG)
|
||||
libomp_append(flags_local -fno-rtti LIBOMP_HAVE_FNO_RTTI_FLAG)
|
||||
if(${LIBOMP_ENABLE_WERROR})
|
||||
libomp_append(flags_local -Werror LIBOMP_HAVE_WERROR_FLAG)
|
||||
endif()
|
||||
libomp_append(flags_local -Wno-sign-compare LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG)
|
||||
libomp_append(flags_local -Wno-unused-function LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG)
|
||||
libomp_append(flags_local -Wno-unused-local-typedef LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG)
|
||||
libomp_append(flags_local -Wno-unused-value LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG)
|
||||
libomp_append(flags_local -Wno-unused-variable LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG)
|
||||
libomp_append(flags_local -Wno-switch LIBOMP_HAVE_WNO_SWITCH_FLAG)
|
||||
libomp_append(flags_local -Wno-covered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
|
||||
libomp_append(flags_local -Wno-deprecated-register LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG)
|
||||
libomp_append(flags_local -Wno-gnu-anonymous-struct LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG)
|
||||
libomp_append(flags_local -Wno-unknown-pragmas LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG)
|
||||
libomp_append(flags_local -Wno-missing-field-initializers LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG)
|
||||
libomp_append(flags_local -Wno-missing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
|
||||
libomp_append(flags_local -Wno-comment LIBOMP_HAVE_WNO_COMMENT_FLAG)
|
||||
libomp_append(flags_local -Wno-self-assign LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG)
|
||||
libomp_append(flags_local -Wno-vla-extension LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG)
|
||||
libomp_append(flags_local -Wno-format-pedantic LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG)
|
||||
libomp_append(flags_local /GS LIBOMP_HAVE_GS_FLAG)
|
||||
libomp_append(flags_local /EHsc LIBOMP_HAVE_EHSC_FLAG)
|
||||
libomp_append(flags_local /Oy- LIBOMP_HAVE_OY__FLAG)
|
||||
# Intel(R) C Compiler flags
|
||||
libomp_append(flags_local /Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
|
||||
libomp_append(flags_local -Qoption,cpp,--extended_float_types LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)
|
||||
libomp_append(flags_local -Qlong_double LIBOMP_HAVE_LONG_DOUBLE_FLAG)
|
||||
libomp_append(flags_local -Qdiag-disable:177 LIBOMP_HAVE_DIAG_DISABLE_177_FLAG)
|
||||
if(${RELEASE_BUILD} OR ${RELWITHDEBINFO_BUILD})
|
||||
libomp_append(flags_local -Qinline-min-size=1 LIBOMP_HAVE_INLINE_MIN_SIZE_FLAG)
|
||||
endif()
|
||||
# Architectural C and C++ flags
|
||||
if(${IA32})
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
libomp_append(flags_local -m32 LIBOMP_HAVE_M32_FLAG)
|
||||
endif()
|
||||
libomp_append(flags_local /arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
|
||||
libomp_append(flags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
|
||||
libomp_append(flags_local -falign-stack=maintain-16-byte LIBOMP_HAVE_FALIGN_STACK_FLAG)
|
||||
elseif(${MIC})
|
||||
libomp_append(flags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
|
||||
libomp_append(flags_local -ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)
|
||||
libomp_append(flags_local "-opt-streaming-stores never" LIBOMP_HAVE_OPT_STREAMING_STORES_FLAG)
|
||||
endif()
|
||||
set(${flags} ${flags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# C compiler flags
|
||||
function(libomp_get_cflags cflags)
|
||||
set(cflags_local)
|
||||
libomp_get_c_and_cxxflags_common(cflags_local)
|
||||
# flags only for the C Compiler
|
||||
libomp_append(cflags_local /TP LIBOMP_HAVE_TP_FLAG)
|
||||
libomp_append(cflags_local "-x c++" LIBOMP_HAVE_X_CPP_FLAG)
|
||||
set(cflags_local ${cflags_local} ${LIBOMP_CFLAGS})
|
||||
libomp_setup_flags(cflags_local)
|
||||
set(${cflags} ${cflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# C++ compiler flags
|
||||
function(libomp_get_cxxflags cxxflags)
|
||||
set(cxxflags_local)
|
||||
libomp_get_c_and_cxxflags_common(cxxflags_local)
|
||||
set(cxxflags_local ${cxxflags_local} ${LIBOMP_CXXFLAGS})
|
||||
libomp_setup_flags(cxxflags_local)
|
||||
set(${cxxflags} ${cxxflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Assembler flags
|
||||
function(libomp_get_asmflags asmflags)
|
||||
set(asmflags_local)
|
||||
libomp_append(asmflags_local "-x assembler-with-cpp" LIBOMP_HAVE_X_ASSEMBLER_WITH_CPP_FLAG)
|
||||
# Architectural assembler flags
|
||||
if(${IA32})
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
|
||||
endif()
|
||||
libomp_append(asmflags_local /safeseh LIBOMP_HAVE_SAFESEH_MASM_FLAG)
|
||||
libomp_append(asmflags_local /coff LIBOMP_HAVE_COFF_MASM_FLAG)
|
||||
elseif(${MIC})
|
||||
libomp_append(asmflags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
|
||||
endif()
|
||||
set(asmflags_local ${asmflags_local} ${LIBOMP_ASMFLAGS})
|
||||
libomp_setup_flags(asmflags_local)
|
||||
set(${asmflags} ${asmflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Linker flags
|
||||
function(libomp_get_ldflags ldflags)
|
||||
set(ldflags_local)
|
||||
libomp_append(ldflags_local "${CMAKE_LINK_DEF_FILE_FLAG}${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_LIB_NAME}.def"
|
||||
IF_DEFINED CMAKE_LINK_DEF_FILE_FLAG)
|
||||
libomp_append(ldflags_local "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}"
|
||||
IF_DEFINED CMAKE_C_OSX_CURRENT_VERSION_FLAG)
|
||||
libomp_append(ldflags_local "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR}"
|
||||
IF_DEFINED CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG)
|
||||
libomp_append(ldflags_local -Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG)
|
||||
libomp_append(ldflags_local -Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG)
|
||||
libomp_append(ldflags_local "-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
|
||||
libomp_append(ldflags_local -static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG)
|
||||
libomp_append(ldflags_local -Wl,-z,noexecstack LIBOMP_HAVE_Z_NOEXECSTACK_FLAG)
|
||||
libomp_append(ldflags_local -Wl,-fini=__kmp_internal_end_fini LIBOMP_HAVE_FINI_FLAG)
|
||||
libomp_append(ldflags_local -no-intel-extensions LIBOMP_HAVE_NO_INTEL_EXTENSIONS_FLAG)
|
||||
libomp_append(ldflags_local -static-intel LIBOMP_HAVE_STATIC_INTEL_FLAG)
|
||||
libomp_append(ldflags_local /SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
|
||||
# Architectural linker flags
|
||||
if(${IA32})
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
libomp_append(ldflags_local -m32 LIBOMP_HAVE_M32_FLAG)
|
||||
endif()
|
||||
libomp_append(ldflags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
|
||||
elseif(${MIC})
|
||||
libomp_append(ldflags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
|
||||
libomp_append(ldflags_local -Wl,-x LIBOMP_HAVE_X_FLAG)
|
||||
endif()
|
||||
set(ldflags_local ${ldflags_local} ${LIBOMP_LDFLAGS})
|
||||
libomp_setup_flags(ldflags_local)
|
||||
set(${ldflags} ${ldflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Library flags
|
||||
function(libomp_get_libflags libflags)
|
||||
set(libflags_local)
|
||||
libomp_append(libflags_local "${CMAKE_THREAD_LIBS_INIT}")
|
||||
libomp_append(libflags_local "${LIBOMP_HWLOC_LIBRARY}" LIBOMP_USE_HWLOC)
|
||||
if(${IA32})
|
||||
libomp_append(libflags_local -lirc_pic LIBOMP_HAVE_IRC_PIC_LIBRARY)
|
||||
endif()
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
libomp_append(libflags_local -lm)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
|
||||
libomp_setup_flags(libflags_local)
|
||||
set(${libflags} ${libflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Fortran flags
|
||||
function(libomp_get_fflags fflags)
|
||||
set(fflags_local)
|
||||
if(${IA32})
|
||||
libomp_append(fflags_local -m32 LIBOMP_HAVE_M32_FORTRAN_FLAG)
|
||||
endif()
|
||||
set(fflags_local ${fflags_local} ${LIBOMP_FFLAGS})
|
||||
libomp_setup_flags(fflags_local)
|
||||
set(${fflags} ${fflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Perl generate-defs.pl flags (For Windows only)
|
||||
function(libomp_get_gdflags gdflags)
|
||||
set(gdflags_local)
|
||||
if(${IA32})
|
||||
set(libomp_gdflag_arch arch_32)
|
||||
elseif(${INTEL64})
|
||||
set(libomp_gdflag_arch arch_32e)
|
||||
else()
|
||||
set(libomp_gdflag_arch arch_${LIBOMP_ARCH})
|
||||
endif()
|
||||
libomp_append(gdflags_local "-D ${libomp_gdflag_arch}")
|
||||
libomp_append(gdflags_local "-D msvc_compat")
|
||||
libomp_append(gdflags_local "-D norm" NORMAL_LIBRARY)
|
||||
libomp_append(gdflags_local "-D prof" PROFILE_LIBRARY)
|
||||
libomp_append(gdflags_local "-D stub" STUBS_LIBRARY)
|
||||
libomp_append(gdflags_local "-D HAVE_QUAD" LIBOMP_USE_QUAD_PRECISION)
|
||||
libomp_append(gdflags_local "-D USE_DEBUGGER" LIBOMP_USE_DEBUGGER)
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 50 OR ${LIBOMP_OMP_VERSION} EQUAL 50)
|
||||
libomp_append(gdflags_local "-D OMP_50")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 45 OR ${LIBOMP_OMP_VERSION} EQUAL 45)
|
||||
libomp_append(gdflags_local "-D OMP_45")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
libomp_append(gdflags_local "-D OMP_40")
|
||||
endif()
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 30 OR ${LIBOMP_OMP_VERSION} EQUAL 30)
|
||||
libomp_append(gdflags_local "-D OMP_30")
|
||||
endif()
|
||||
if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD})
|
||||
libomp_append(gdflags_local "-D KMP_DEBUG")
|
||||
endif()
|
||||
set(${gdflags} ${gdflags_local} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -0,0 +1,228 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# The following micro-tests are small tests to perform on the library just created.
|
||||
# There are currently five micro-tests:
|
||||
# (1) test-touch
|
||||
# - Compile and run a small program using newly created libomp library
|
||||
# - Fails if test-touch.c does not compile or if test-touch.c does not run after compilation
|
||||
# - Program dependencies: gcc or g++, grep, bourne shell
|
||||
# - Available for all Unix,Mac,Windows builds. Not available on Intel(R) MIC Architecture builds.
|
||||
# (2) test-relo
|
||||
# - Tests dynamic libraries for position-dependent code (can not have any position dependent code)
|
||||
# - Fails if TEXTREL is in output of readelf -d libomp.so command
|
||||
# - Program dependencies: readelf, grep, bourne shell
|
||||
# - Available for Unix, Intel(R) MIC Architecture dynamic library builds. Not available otherwise.
|
||||
# (3) test-execstack
|
||||
# - Tests if stack is executable
|
||||
# - Fails if stack is executable. Should only be readable and writable. Not exectuable.
|
||||
# - Program dependencies: perl, readelf
|
||||
# - Available for Unix dynamic library builds. Not available otherwise.
|
||||
# (4) test-instr (Intel(R) MIC Architecutre only)
|
||||
# - Tests Intel(R) MIC Architecture libraries for valid instruction set
|
||||
# - Fails if finds invalid instruction for Intel(R) MIC Architecture (wasn't compiled with correct flags)
|
||||
# - Program dependencies: perl, objdump
|
||||
# - Available for Intel(R) MIC Architecture and i386 builds. Not available otherwise.
|
||||
# (5) test-deps
|
||||
# - Tests newly created libomp for library dependencies
|
||||
# - Fails if sees a dependence not listed in td_exp variable below
|
||||
# - Program dependencies: perl, (unix)readelf, (mac)otool[64], (windows)link.exe
|
||||
# - Available for Unix,Mac,Windows, Intel(R) MIC Architecture dynamic builds and Windows
|
||||
# static builds. Not available otherwise.
|
||||
|
||||
# get library location
|
||||
if(WIN32)
|
||||
get_target_property(LIBOMP_OUTPUT_DIRECTORY omp RUNTIME_OUTPUT_DIRECTORY)
|
||||
get_target_property(LIBOMPIMP_OUTPUT_DIRECTORY ompimp ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if(NOT LIBOMPIMP_OUTPUT_DIRECTORY)
|
||||
set(LIBOMPIMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
else()
|
||||
get_target_property(LIBOMP_OUTPUT_DIRECTORY omp LIBRARY_OUTPUT_DIRECTORY)
|
||||
endif()
|
||||
if(NOT LIBOMP_OUTPUT_DIRECTORY)
|
||||
set(LIBOMP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
# test-touch
|
||||
find_program(LIBOMP_SHELL sh)
|
||||
if(WIN32)
|
||||
if(LIBOMP_SHELL)
|
||||
set(libomp_test_touch_targets test-touch-md/.success test-touch-mt/.success)
|
||||
endif()
|
||||
# pick test-touch compiler
|
||||
set(libomp_test_touch_compiler ${CMAKE_C_COMPILER})
|
||||
# test-touch compilation flags
|
||||
libomp_append(libomp_test_touch_cflags /nologo)
|
||||
libomp_append(libomp_test_touch_libs ${LIBOMPIMP_OUTPUT_DIRECTORY}/${LIBOMP_IMP_LIB_FILE})
|
||||
if(${IA32})
|
||||
libomp_append(libomp_test_touch_ldflags /safeseh)
|
||||
endif()
|
||||
else() # (Unix based systems, Intel(R) MIC Architecture, and Mac)
|
||||
if(LIBOMP_SHELL)
|
||||
set(libomp_test_touch_targets test-touch-rt/.success)
|
||||
endif()
|
||||
# pick test-touch compiler
|
||||
if(${LIBOMP_USE_STDCPPLIB})
|
||||
set(libomp_test_touch_compiler ${CMAKE_CXX_COMPILER})
|
||||
else()
|
||||
set(libomp_test_touch_compiler ${CMAKE_C_COMPILER})
|
||||
endif()
|
||||
# test-touch compilation flags
|
||||
libomp_append(libomp_test_touch_libs "${CMAKE_THREAD_LIBS_INIT}")
|
||||
if(${IA32})
|
||||
libomp_append(libomp_test_touch_cflags -m32 LIBOMP_HAVE_M32_FLAG)
|
||||
endif()
|
||||
libomp_append(libomp_test_touch_libs ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE})
|
||||
libomp_append(libomp_test_touch_libs "${LIBOMP_HWLOC_LIBRARY}" LIBOMP_USE_HWLOC)
|
||||
if(APPLE)
|
||||
set(libomp_test_touch_env "DYLD_LIBRARY_PATH=.:${LIBOMP_OUTPUT_DIRECTORY}:$ENV{DYLD_LIBRARY_PATH}")
|
||||
libomp_append(libomp_test_touch_ldflags "-Wl,-rpath,${LIBOMP_HWLOC_LIBRARY_DIR}" LIBOMP_USE_HWLOC)
|
||||
else()
|
||||
set(libomp_test_touch_env "LD_LIBRARY_PATH=.:${LIBOMP_OUTPUT_DIRECTORY}:$ENV{LD_LIBRARY_PATH}")
|
||||
libomp_append(libomp_test_touch_ldflags "-Wl,-rpath=${LIBOMP_HWLOC_LIBRARY_DIR}" LIBOMP_USE_HWLOC)
|
||||
endif()
|
||||
endif()
|
||||
macro(libomp_test_touch_recipe test_touch_dir)
|
||||
set(libomp_test_touch_dependencies ${LIBOMP_SRC_DIR}/test-touch.c omp)
|
||||
set(libomp_test_touch_exe ${test_touch_dir}/test-touch${CMAKE_EXECUTABLE_SUFFIX})
|
||||
set(libomp_test_touch_obj ${test_touch_dir}/test-touch${CMAKE_C_OUTPUT_EXTENSION})
|
||||
if(WIN32)
|
||||
if(${RELEASE_BUILD} OR ${RELWITHDEBINFO_BUILD})
|
||||
if(${test_touch_dir} MATCHES "test-touch-mt")
|
||||
libomp_append(libomp_test_touch_cflags /MT)
|
||||
else()
|
||||
libomp_append(libomp_test_touch_cflags /MD)
|
||||
endif()
|
||||
else()
|
||||
if(${test_touch_dir} MATCHES "test-touch-mt")
|
||||
libomp_append(libomp_test_touch_cflags /MTd)
|
||||
else()
|
||||
libomp_append(libomp_test_touch_cflags /MDd)
|
||||
endif()
|
||||
endif()
|
||||
set(libomp_test_touch_out_flags -Fe${libomp_test_touch_exe} -Fo${libomp_test_touch_obj})
|
||||
list(APPEND libomp_test_touch_dependencies ompimp)
|
||||
else()
|
||||
set(libomp_test_touch_out_flags -o ${libomp_test_touch_exe})
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${test_touch_dir}/.success ${libomp_test_touch_exe} ${libomp_test_touch_obj}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${test_touch_dir}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${test_touch_dir}/*
|
||||
COMMAND ${libomp_test_touch_compiler} ${libomp_test_touch_out_flags} ${libomp_test_touch_cflags}
|
||||
${LIBOMP_SRC_DIR}/test-touch.c ${libomp_test_touch_ldflags} ${libomp_test_touch_libs}
|
||||
COMMAND ${LIBOMP_SHELL} -c \"${libomp_test_touch_env} ${libomp_test_touch_exe}\"
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${test_touch_dir}/.success
|
||||
DEPENDS ${libomp_test_touch_dependencies}
|
||||
)
|
||||
endmacro()
|
||||
libomp_append(libomp_test_touch_env "KMP_VERSION=1")
|
||||
add_custom_target(libomp-test-touch DEPENDS ${libomp_test_touch_targets})
|
||||
if(WIN32)
|
||||
libomp_test_touch_recipe(test-touch-mt)
|
||||
libomp_test_touch_recipe(test-touch-md)
|
||||
else()
|
||||
libomp_test_touch_recipe(test-touch-rt)
|
||||
endif()
|
||||
|
||||
# test-relo
|
||||
add_custom_target(libomp-test-relo DEPENDS test-relo/.success)
|
||||
add_custom_command(
|
||||
OUTPUT test-relo/.success test-relo/readelf.log
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-relo
|
||||
COMMAND readelf -d ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE} > test-relo/readelf.log
|
||||
COMMAND grep -e TEXTREL test-relo/readelf.log \; test $$? -eq 1
|
||||
COMMAND ${CMAKE_COMMAND} -E touch test-relo/.success
|
||||
DEPENDS omp
|
||||
)
|
||||
|
||||
# test-execstack
|
||||
add_custom_target(libomp-test-execstack DEPENDS test-execstack/.success)
|
||||
add_custom_command(
|
||||
OUTPUT test-execstack/.success
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-execstack
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-execstack.pl
|
||||
--arch=${LIBOMP_PERL_SCRIPT_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch test-execstack/.success
|
||||
DEPENDS omp
|
||||
)
|
||||
|
||||
# test-instr
|
||||
add_custom_target(libomp-test-instr DEPENDS test-instr/.success)
|
||||
add_custom_command(
|
||||
OUTPUT test-instr/.success
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-instr
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-instruction-set.pl --os=${LIBOMP_PERL_SCRIPT_OS}
|
||||
--arch=${LIBOMP_PERL_SCRIPT_ARCH} --show --mic-arch=${LIBOMP_MIC_ARCH} ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch test-instr/.success
|
||||
DEPENDS omp ${LIBOMP_TOOLS_DIR}/check-instruction-set.pl
|
||||
)
|
||||
|
||||
# test-deps
|
||||
add_custom_target(libomp-test-deps DEPENDS test-deps/.success)
|
||||
set(libomp_expected_library_deps)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
set(libomp_expected_library_deps libc.so.7 libthr.so.3)
|
||||
libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||
set(libomp_expected_library_deps libc.so.12 libpthread.so.1 libm.so.0)
|
||||
libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC)
|
||||
elseif(APPLE)
|
||||
set(libomp_expected_library_deps /usr/lib/libSystem.B.dylib)
|
||||
elseif(WIN32)
|
||||
set(libomp_expected_library_deps kernel32.dll)
|
||||
libomp_append(libomp_expected_library_deps psapi.dll LIBOMP_OMPT_SUPPORT)
|
||||
else()
|
||||
if(${MIC})
|
||||
set(libomp_expected_library_deps libc.so.6 libpthread.so.0 libdl.so.2)
|
||||
if("${LIBOMP_MIC_ARCH}" STREQUAL "knf")
|
||||
libomp_append(libomp_expected_library_deps ld-linux-l1om.so.2)
|
||||
libomp_append(libomp_expected_library_deps libgcc_s.so.1)
|
||||
elseif("${LIBOMP_MIC_ARCH}" STREQUAL "knc")
|
||||
libomp_append(libomp_expected_library_deps ld-linux-k1om.so.2)
|
||||
endif()
|
||||
else()
|
||||
set(libomp_expected_library_deps libdl.so.2 libgcc_s.so.1)
|
||||
if(${IA32})
|
||||
libomp_append(libomp_expected_library_deps libc.so.6)
|
||||
libomp_append(libomp_expected_library_deps ld-linux.so.2)
|
||||
elseif(${INTEL64})
|
||||
libomp_append(libomp_expected_library_deps libc.so.6)
|
||||
libomp_append(libomp_expected_library_deps ld-linux-x86-64.so.2)
|
||||
elseif(${ARM})
|
||||
libomp_append(libomp_expected_library_deps libc.so.6)
|
||||
libomp_append(libomp_expected_library_deps libffi.so.6)
|
||||
libomp_append(libomp_expected_library_deps libffi.so.5)
|
||||
libomp_append(libomp_expected_library_deps ld-linux-armhf.so.3)
|
||||
elseif(${PPC64})
|
||||
libomp_append(libomp_expected_library_deps libc.so.6)
|
||||
libomp_append(libomp_expected_library_deps ld64.so.1)
|
||||
elseif(${MIPS} OR ${MIPS64})
|
||||
libomp_append(libomp_expected_library_deps libc.so.6)
|
||||
libomp_append(libomp_expected_library_deps ld.so.1)
|
||||
endif()
|
||||
libomp_append(libomp_expected_library_deps libpthread.so.0 IF_FALSE STUBS_LIBRARY)
|
||||
libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC)
|
||||
endif()
|
||||
libomp_append(libomp_expected_library_deps libstdc++.so.6 LIBOMP_USE_STDCPPLIB)
|
||||
libomp_append(libomp_expected_library_deps libm.so.6 LIBOMP_STATS)
|
||||
endif()
|
||||
# Perl script expects comma separated list
|
||||
string(REPLACE ";" "," libomp_expected_library_deps "${libomp_expected_library_deps}")
|
||||
add_custom_command(
|
||||
OUTPUT test-deps/.success
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/test-deps
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/check-depends.pl --os=${LIBOMP_PERL_SCRIPT_OS}
|
||||
--arch=${LIBOMP_PERL_SCRIPT_ARCH} --expected="${libomp_expected_library_deps}" ${LIBOMP_OUTPUT_DIRECTORY}/${LIBOMP_LIB_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch test-deps/.success
|
||||
DEPENDS omp ${LIBOMP_TOOLS_DIR}/check-depends.pl
|
||||
)
|
||||
@@ -0,0 +1,195 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# void libomp_say(string message_to_user);
|
||||
# - prints out message_to_user
|
||||
macro(libomp_say message_to_user)
|
||||
message(STATUS "LIBOMP: ${message_to_user}")
|
||||
endmacro()
|
||||
|
||||
# void libomp_warning_say(string message_to_user);
|
||||
# - prints out message_to_user with a warning
|
||||
macro(libomp_warning_say message_to_user)
|
||||
message(WARNING "LIBOMP: ${message_to_user}")
|
||||
endmacro()
|
||||
|
||||
# void libomp_error_say(string message_to_user);
|
||||
# - prints out message_to_user with an error and exits cmake
|
||||
macro(libomp_error_say message_to_user)
|
||||
message(FATAL_ERROR "LIBOMP: ${message_to_user}")
|
||||
endmacro()
|
||||
|
||||
# libomp_append(<flag> <flags_list> [(IF_TRUE | IF_FALSE | IF_TRUE_1_0 ) BOOLEAN])
|
||||
#
|
||||
# libomp_append(<flag> <flags_list>)
|
||||
# - unconditionally appends <flag> to the list of definitions
|
||||
#
|
||||
# libomp_append(<flag> <flags_list> <BOOLEAN>)
|
||||
# - appends <flag> to the list of definitions if BOOLEAN is true
|
||||
#
|
||||
# libomp_append(<flag> <flags_list> IF_TRUE <BOOLEAN>)
|
||||
# - appends <flag> to the list of definitions if BOOLEAN is true
|
||||
#
|
||||
# libomp_append(<flag> <flags_list> IF_FALSE <BOOLEAN>)
|
||||
# - appends <flag> to the list of definitions if BOOLEAN is false
|
||||
#
|
||||
# libomp_append(<flag> <flags_list> IF_DEFINED <VARIABLE>)
|
||||
# - appends <flag> to the list of definitions if VARIABLE is defined
|
||||
#
|
||||
# libomp_append(<flag> <flags_list> IF_TRUE_1_0 <BOOLEAN>)
|
||||
# - appends <flag>=1 to the list of definitions if <BOOLEAN> is true, <flag>=0 otherwise
|
||||
# e.g., libomp_append("-D USE_FEATURE" IF_TRUE_1_0 HAVE_FEATURE)
|
||||
# appends "-D USE_FEATURE=1" if HAVE_FEATURE is true
|
||||
# or "-D USE_FEATURE=0" if HAVE_FEATURE is false
|
||||
macro(libomp_append flags flag)
|
||||
if(NOT (${ARGC} EQUAL 2 OR ${ARGC} EQUAL 3 OR ${ARGC} EQUAL 4))
|
||||
libomp_error_say("libomp_append: takes 2, 3, or 4 arguments")
|
||||
endif()
|
||||
if(${ARGC} EQUAL 2)
|
||||
list(APPEND ${flags} "${flag}")
|
||||
elseif(${ARGC} EQUAL 3)
|
||||
if(${ARGV2})
|
||||
list(APPEND ${flags} "${flag}")
|
||||
endif()
|
||||
else()
|
||||
if(${ARGV2} STREQUAL "IF_TRUE")
|
||||
if(${ARGV3})
|
||||
list(APPEND ${flags} "${flag}")
|
||||
endif()
|
||||
elseif(${ARGV2} STREQUAL "IF_FALSE")
|
||||
if(NOT ${ARGV3})
|
||||
list(APPEND ${flags} "${flag}")
|
||||
endif()
|
||||
elseif(${ARGV2} STREQUAL "IF_DEFINED")
|
||||
if(DEFINED ${ARGV3})
|
||||
list(APPEND ${flags} "${flag}")
|
||||
endif()
|
||||
elseif(${ARGV2} STREQUAL "IF_TRUE_1_0")
|
||||
if(${ARGV3})
|
||||
list(APPEND ${flags} "${flag}=1")
|
||||
else()
|
||||
list(APPEND ${flags} "${flag}=0")
|
||||
endif()
|
||||
else()
|
||||
libomp_error_say("libomp_append: third argument must be one of IF_TRUE, IF_FALSE, IF_DEFINED, IF_TRUE_1_0")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# void libomp_get_legal_arch(string* return_arch_string);
|
||||
# - returns (through return_arch_string) the formal architecture
|
||||
# string or warns user of unknown architecture
|
||||
function(libomp_get_legal_arch return_arch_string)
|
||||
if(${IA32})
|
||||
set(${return_arch_string} "IA-32" PARENT_SCOPE)
|
||||
elseif(${INTEL64})
|
||||
set(${return_arch_string} "Intel(R) 64" PARENT_SCOPE)
|
||||
elseif(${MIC})
|
||||
set(${return_arch_string} "Intel(R) Many Integrated Core Architecture" PARENT_SCOPE)
|
||||
elseif(${ARM})
|
||||
set(${return_arch_string} "ARM" PARENT_SCOPE)
|
||||
elseif(${PPC64BE})
|
||||
set(${return_arch_string} "PPC64BE" PARENT_SCOPE)
|
||||
elseif(${PPC64LE})
|
||||
set(${return_arch_string} "PPC64LE" PARENT_SCOPE)
|
||||
elseif(${AARCH64})
|
||||
set(${return_arch_string} "AARCH64" PARENT_SCOPE)
|
||||
elseif(${MIPS})
|
||||
set(${return_arch_string} "MIPS" PARENT_SCOPE)
|
||||
elseif(${MIPS64})
|
||||
set(${return_arch_string} "MIPS64" PARENT_SCOPE)
|
||||
else()
|
||||
set(${return_arch_string} "${LIBOMP_ARCH}" PARENT_SCOPE)
|
||||
libomp_warning_say("libomp_get_legal_arch(): Warning: Unknown architecture: Using ${LIBOMP_ARCH}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# void libomp_check_variable(string var, ...);
|
||||
# - runs through all values checking if ${var} == value
|
||||
# - uppercase and lowercase do not matter
|
||||
# - if the var is found, then just print it out
|
||||
# - if the var is not found, then error out
|
||||
function(libomp_check_variable var)
|
||||
set(valid_flag 0)
|
||||
string(TOLOWER "${${var}}" var_lower)
|
||||
foreach(value IN LISTS ARGN)
|
||||
string(TOLOWER "${value}" value_lower)
|
||||
if("${var_lower}" STREQUAL "${value_lower}")
|
||||
set(valid_flag 1)
|
||||
set(the_value "${value}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(${valid_flag} EQUAL 0)
|
||||
libomp_error_say("libomp_check_variable(): ${var} = ${${var}} is unknown")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# void libomp_get_build_number(string src_dir, string* return_build_number);
|
||||
# - grab the eight digit build number (or 00000000) from kmp_version.cpp
|
||||
function(libomp_get_build_number src_dir return_build_number)
|
||||
# sets file_lines_list to a list of all lines in kmp_version.cpp
|
||||
file(STRINGS "${src_dir}/src/kmp_version.cpp" file_lines_list)
|
||||
|
||||
# runs through each line in kmp_version.cpp
|
||||
foreach(line IN LISTS file_lines_list)
|
||||
# if the line begins with "#define KMP_VERSION_BUILD" then we take not of the build number
|
||||
string(REGEX MATCH "^[ \t]*#define[ \t]+KMP_VERSION_BUILD" valid "${line}")
|
||||
if(NOT "${valid}" STREQUAL "") # if we matched "#define KMP_VERSION_BUILD", then grab the build number
|
||||
string(REGEX REPLACE "^[ \t]*#define[ \t]+KMP_VERSION_BUILD[ \t]+([0-9]+)" "\\1"
|
||||
build_number "${line}"
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
set(${return_build_number} "${build_number}" PARENT_SCOPE) # return build number
|
||||
endfunction()
|
||||
|
||||
# void libomp_get_legal_type(string* return_legal_type);
|
||||
# - set the legal type name Performance/Profiling/Stub
|
||||
function(libomp_get_legal_type return_legal_type)
|
||||
if(${NORMAL_LIBRARY})
|
||||
set(${return_legal_type} "Performance" PARENT_SCOPE)
|
||||
elseif(${PROFILE_LIBRARY})
|
||||
set(${return_legal_type} "Profiling" PARENT_SCOPE)
|
||||
elseif(${STUBS_LIBRARY})
|
||||
set(${return_legal_type} "Stub" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# void libomp_add_suffix(string suffix, list<string>* list_of_items);
|
||||
# - returns list_of_items with suffix appended to all items
|
||||
# - original list is modified
|
||||
function(libomp_add_suffix suffix list_of_items)
|
||||
set(local_list "")
|
||||
foreach(item IN LISTS "${list_of_items}")
|
||||
if(NOT "${item}" STREQUAL "")
|
||||
list(APPEND local_list "${item}${suffix}")
|
||||
endif()
|
||||
endforeach()
|
||||
set(${list_of_items} "${local_list}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# void libomp_list_to_string(list<string> list_of_things, string* return_string);
|
||||
# - converts a list to a space separated string
|
||||
function(libomp_list_to_string list_of_things return_string)
|
||||
string(REPLACE ";" " " output_variable "${list_of_things}")
|
||||
set(${return_string} "${output_variable}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# void libomp_string_to_list(string str, list<string>* return_list);
|
||||
# - converts a string to a semicolon separated list
|
||||
# - what it really does is just string_replace all running whitespace to a semicolon
|
||||
# - in cmake, a list is strings separated by semicolons: i.e., list of four items, list = "item1;item2;item3;item4"
|
||||
function(libomp_string_to_list str return_list)
|
||||
set(outstr)
|
||||
string(REGEX REPLACE "[ \t]+" ";" outstr "${str}")
|
||||
set(${return_list} "${outstr}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckIncludeFiles)
|
||||
include(LibompCheckLinkerFlag)
|
||||
include(LibompCheckFortranFlag)
|
||||
|
||||
# Check for versioned symbols
|
||||
function(libomp_check_version_symbols retval)
|
||||
set(source_code
|
||||
"#include <stdio.h>
|
||||
void func1() { printf(\"Hello\"); }
|
||||
void func2() { printf(\"World\"); }
|
||||
__asm__(\".symver func1, func@VER1\");
|
||||
__asm__(\".symver func2, func@VER2\");
|
||||
int main() {
|
||||
func1();
|
||||
func2();
|
||||
return 0;
|
||||
}")
|
||||
set(version_script_source "VER1 { }; VER2 { } VER1;")
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/__version_script.txt "${version_script_source}")
|
||||
set(CMAKE_REQUIRED_FLAGS -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/__version_script.txt)
|
||||
check_c_source_compiles("${source_code}" ${retval})
|
||||
set(${retval} ${${retval}} PARENT_SCOPE)
|
||||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/__version_script.txt)
|
||||
endfunction()
|
||||
|
||||
# Includes the architecture flag in both compile and link phase
|
||||
function(libomp_check_architecture_flag flag retval)
|
||||
set(CMAKE_REQUIRED_FLAGS "${flag}")
|
||||
check_c_compiler_flag("${flag}" ${retval})
|
||||
set(${retval} ${${retval}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Checking C, CXX, Linker Flags
|
||||
check_cxx_compiler_flag(-std=c++11 LIBOMP_HAVE_STD_CPP11_FLAG)
|
||||
check_cxx_compiler_flag(-fno-exceptions LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG)
|
||||
check_cxx_compiler_flag(-fno-rtti LIBOMP_HAVE_FNO_RTTI_FLAG)
|
||||
check_c_compiler_flag("-x c++" LIBOMP_HAVE_X_CPP_FLAG)
|
||||
check_c_compiler_flag(-Werror LIBOMP_HAVE_WERROR_FLAG)
|
||||
check_c_compiler_flag(-Wunused-function LIBOMP_HAVE_WNO_UNUSED_FUNCTION_FLAG)
|
||||
check_c_compiler_flag(-Wunused-local-typedef LIBOMP_HAVE_WNO_UNUSED_LOCAL_TYPEDEF_FLAG)
|
||||
check_c_compiler_flag(-Wunused-value LIBOMP_HAVE_WNO_UNUSED_VALUE_FLAG)
|
||||
check_c_compiler_flag(-Wunused-variable LIBOMP_HAVE_WNO_UNUSED_VARIABLE_FLAG)
|
||||
check_c_compiler_flag(-Wswitch LIBOMP_HAVE_WNO_SWITCH_FLAG)
|
||||
check_c_compiler_flag(-Wcovered-switch-default LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG)
|
||||
check_c_compiler_flag(-Wdeprecated-register LIBOMP_HAVE_WNO_DEPRECATED_REGISTER_FLAG)
|
||||
check_c_compiler_flag(-Wsign-compare LIBOMP_HAVE_WNO_SIGN_COMPARE_FLAG)
|
||||
check_c_compiler_flag(-Wgnu-anonymous-struct LIBOMP_HAVE_WNO_GNU_ANONYMOUS_STRUCT_FLAG)
|
||||
check_c_compiler_flag(-Wunknown-pragmas LIBOMP_HAVE_WNO_UNKNOWN_PRAGMAS_FLAG)
|
||||
check_c_compiler_flag(-Wmissing-field-initializers LIBOMP_HAVE_WNO_MISSING_FIELD_INITIALIZERS_FLAG)
|
||||
check_c_compiler_flag(-Wmissing-braces LIBOMP_HAVE_WNO_MISSING_BRACES_FLAG)
|
||||
check_c_compiler_flag(-Wcomment LIBOMP_HAVE_WNO_COMMENT_FLAG)
|
||||
check_c_compiler_flag(-Wself-assign LIBOMP_HAVE_WNO_SELF_ASSIGN_FLAG)
|
||||
check_c_compiler_flag(-Wvla-extension LIBOMP_HAVE_WNO_VLA_EXTENSION_FLAG)
|
||||
check_c_compiler_flag(-Wformat-pedantic LIBOMP_HAVE_WNO_FORMAT_PEDANTIC_FLAG)
|
||||
check_c_compiler_flag(-msse2 LIBOMP_HAVE_MSSE2_FLAG)
|
||||
check_c_compiler_flag(-ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)
|
||||
libomp_check_architecture_flag(-mmic LIBOMP_HAVE_MMIC_FLAG)
|
||||
libomp_check_architecture_flag(-m32 LIBOMP_HAVE_M32_FLAG)
|
||||
if(WIN32)
|
||||
# Check Windows MSVC style flags.
|
||||
check_c_compiler_flag(/TP LIBOMP_HAVE_TP_FLAG)
|
||||
check_cxx_compiler_flag(/EHsc LIBOMP_HAVE_EHSC_FLAG)
|
||||
check_cxx_compiler_flag(/GS LIBOMP_HAVE_GS_FLAG)
|
||||
check_cxx_compiler_flag(/Oy- LIBOMP_HAVE_Oy__FLAG)
|
||||
check_cxx_compiler_flag(/arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
|
||||
check_cxx_compiler_flag(/Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
|
||||
# It is difficult to create a dummy masm assembly file
|
||||
# and then check the MASM assembler to see if these flags exist and work,
|
||||
# so we assume they do for Windows.
|
||||
set(LIBOMP_HAVE_SAFESEH_MASM_FLAG TRUE)
|
||||
set(LIBOMP_HAVE_COFF_MASM_FLAG TRUE)
|
||||
# Change Windows flags /MDx to /MTx
|
||||
foreach(libomp_lang IN ITEMS C CXX)
|
||||
foreach(libomp_btype IN ITEMS DEBUG RELWITHDEBINFO RELEASE MINSIZEREL)
|
||||
string(REPLACE "/MD" "/MT"
|
||||
CMAKE_${libomp_lang}_FLAGS_${libomp_btype}
|
||||
"${CMAKE_${libomp_lang}_FLAGS_${libomp_btype}}"
|
||||
)
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
# It is difficult to create a dummy assembly file that compiles into an
|
||||
# exectuable for every architecture and then check the C compiler to
|
||||
# see if -x assembler-with-cpp exists and works, so we assume it does for non-Windows.
|
||||
set(LIBOMP_HAVE_X_ASSEMBLER_WITH_CPP_FLAG TRUE)
|
||||
endif()
|
||||
if(${LIBOMP_FORTRAN_MODULES})
|
||||
libomp_check_fortran_flag(-m32 LIBOMP_HAVE_M32_FORTRAN_FLAG)
|
||||
endif()
|
||||
|
||||
# Check linker flags
|
||||
if(WIN32)
|
||||
libomp_check_linker_flag(/SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
|
||||
elseif(NOT APPLE)
|
||||
libomp_check_linker_flag(-Wl,-x LIBOMP_HAVE_X_FLAG)
|
||||
libomp_check_linker_flag(-Wl,--warn-shared-textrel LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG)
|
||||
libomp_check_linker_flag(-Wl,--as-needed LIBOMP_HAVE_AS_NEEDED_FLAG)
|
||||
libomp_check_linker_flag("-Wl,--version-script=${LIBOMP_SRC_DIR}/exports_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
|
||||
libomp_check_linker_flag(-static-libgcc LIBOMP_HAVE_STATIC_LIBGCC_FLAG)
|
||||
libomp_check_linker_flag(-Wl,-z,noexecstack LIBOMP_HAVE_Z_NOEXECSTACK_FLAG)
|
||||
libomp_check_linker_flag(-Wl,-fini=__kmp_internal_end_fini LIBOMP_HAVE_FINI_FLAG)
|
||||
endif()
|
||||
|
||||
# Check Intel(R) C Compiler specific flags
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
|
||||
check_cxx_compiler_flag(/Qlong_double LIBOMP_HAVE_LONG_DOUBLE_FLAG)
|
||||
check_cxx_compiler_flag(/Qdiag-disable:177 LIBOMP_HAVE_DIAG_DISABLE_177_FLAG)
|
||||
check_cxx_compiler_flag(/Qinline-min-size=1 LIBOMP_HAVE_INLINE_MIN_SIZE_FLAG)
|
||||
check_cxx_compiler_flag(-Qoption,cpp,--extended_float_types LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)
|
||||
check_cxx_compiler_flag(-falign-stack=maintain-16-byte LIBOMP_HAVE_FALIGN_STACK_FLAG)
|
||||
check_cxx_compiler_flag("-opt-streaming-stores never" LIBOMP_HAVE_OPT_STREAMING_STORES_FLAG)
|
||||
libomp_check_linker_flag(-static-intel LIBOMP_HAVE_STATIC_INTEL_FLAG)
|
||||
libomp_check_linker_flag(-no-intel-extensions LIBOMP_HAVE_NO_INTEL_EXTENSIONS_FLAG)
|
||||
check_library_exists(irc_pic _intel_fast_memcpy "" LIBOMP_HAVE_IRC_PIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
# Checking Threading requirements
|
||||
find_package(Threads REQUIRED)
|
||||
if(WIN32)
|
||||
if(NOT CMAKE_USE_WIN32_THREADS_INIT)
|
||||
libomp_error_say("Need Win32 thread interface on Windows.")
|
||||
endif()
|
||||
else()
|
||||
if(NOT CMAKE_USE_PTHREADS_INIT)
|
||||
libomp_error_say("Need pthread interface on Unix-like systems.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find perl executable
|
||||
# Perl is used to create omp.h (and other headers) along with kmp_i18n_id.inc and kmp_i18n_default.inc
|
||||
find_package(Perl REQUIRED)
|
||||
# The perl scripts take the --os=/--arch= flags which expect a certain format for operating systems and arch's.
|
||||
# Until the perl scripts are removed, the most portable way to handle this is to have all operating systems that
|
||||
# are neither Windows nor Mac (Most Unix flavors) be considered lin to the perl scripts. This is rooted
|
||||
# in that all the Perl scripts check the operating system and will fail if it isn't "valid". This
|
||||
# temporary solution lets us avoid trying to enumerate all the possible OS values inside the Perl modules.
|
||||
if(WIN32)
|
||||
set(LIBOMP_PERL_SCRIPT_OS win)
|
||||
elseif(APPLE)
|
||||
set(LIBOMP_PERL_SCRIPT_OS mac)
|
||||
else()
|
||||
set(LIBOMP_PERL_SCRIPT_OS lin)
|
||||
endif()
|
||||
if(IA32)
|
||||
set(LIBOMP_PERL_SCRIPT_ARCH 32)
|
||||
elseif(MIC)
|
||||
set(LIBOMP_PERL_SCRIPT_ARCH mic)
|
||||
elseif(INTEL64)
|
||||
set(LIBOMP_PERL_SCRIPT_ARCH 32e)
|
||||
else()
|
||||
set(LIBOMP_PERL_SCRIPT_ARCH ${LIBOMP_ARCH})
|
||||
endif()
|
||||
|
||||
# Checking features
|
||||
# Check if version symbol assembler directives are supported
|
||||
libomp_check_version_symbols(LIBOMP_HAVE_VERSION_SYMBOLS)
|
||||
|
||||
# Check if quad precision types are available
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set(LIBOMP_HAVE_QUAD_PRECISION TRUE)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
|
||||
if(LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)
|
||||
set(LIBOMP_HAVE_QUAD_PRECISION TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_QUAD_PRECISION TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(LIBOMP_HAVE_QUAD_PRECISION FALSE)
|
||||
endif()
|
||||
|
||||
# Check if adaptive locks are available
|
||||
if((${IA32} OR ${INTEL64}) AND NOT MSVC)
|
||||
set(LIBOMP_HAVE_ADAPTIVE_LOCKS TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_ADAPTIVE_LOCKS FALSE)
|
||||
endif()
|
||||
|
||||
# Check if stats-gathering is available
|
||||
if(${LIBOMP_STATS})
|
||||
check_c_source_compiles(
|
||||
"__thread int x;
|
||||
int main(int argc, char** argv)
|
||||
{ x = argc; return x; }"
|
||||
LIBOMP_HAVE___THREAD)
|
||||
check_c_source_compiles(
|
||||
"int main(int argc, char** argv)
|
||||
{ unsigned long long t = __builtin_readcyclecounter(); return 0; }"
|
||||
LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER)
|
||||
if(NOT LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER)
|
||||
if(${IA32} OR ${INTEL64} OR ${MIC})
|
||||
check_include_file(x86intrin.h LIBOMP_HAVE_X86INTRIN_H)
|
||||
libomp_append(CMAKE_REQUIRED_DEFINITIONS -DLIBOMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H)
|
||||
check_c_source_compiles(
|
||||
"#ifdef LIBOMP_HAVE_X86INTRIN_H
|
||||
# include <x86intrin.h>
|
||||
#endif
|
||||
int main(int argc, char** argv) { unsigned long long t = __rdtsc(); return 0; }" LIBOMP_HAVE___RDTSC)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS)
|
||||
endif()
|
||||
endif()
|
||||
if(LIBOMP_HAVE___THREAD AND (LIBOMP_HAVE___RDTSC OR LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER))
|
||||
set(LIBOMP_HAVE_STATS TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_STATS FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check if OMPT support is available
|
||||
# Currently, __builtin_frame_address() is required for OMPT
|
||||
# Weak attribute is required for Unices, LIBPSAPI is used for Windows
|
||||
check_c_source_compiles("int main(int argc, char** argv) {
|
||||
void* p = __builtin_frame_address(0);
|
||||
return 0;}" LIBOMP_HAVE___BUILTIN_FRAME_ADDRESS)
|
||||
check_c_source_compiles("__attribute__ ((weak)) int foo(int a) { return a*a; }
|
||||
int main(int argc, char** argv) {
|
||||
return foo(argc);}" LIBOMP_HAVE_WEAK_ATTRIBUTE)
|
||||
check_include_files("windows.h;psapi.h" LIBOMP_HAVE_PSAPI_H)
|
||||
check_library_exists(psapi EnumProcessModules "" LIBOMP_HAVE_LIBPSAPI)
|
||||
if(LIBOMP_HAVE_PSAPI_H AND LIBOMP_HAVE_LIBPSAPI)
|
||||
set(LIBOMP_HAVE_PSAPI TRUE)
|
||||
endif()
|
||||
if(NOT LIBOMP_HAVE___BUILTIN_FRAME_ADDRESS)
|
||||
set(LIBOMP_HAVE_OMPT_SUPPORT FALSE)
|
||||
else()
|
||||
if(LIBOMP_HAVE_WEAK_ATTRIBUTE OR LIBOMP_HAVE_PSAPI)
|
||||
set(LIBOMP_HAVE_OMPT_SUPPORT TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_OMPT_SUPPORT FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check if HWLOC support is available
|
||||
if(${LIBOMP_USE_HWLOC})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${LIBOMP_HWLOC_INSTALL_DIR}/include)
|
||||
check_include_file(hwloc.h LIBOMP_HAVE_HWLOC_H)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
find_library(LIBOMP_HWLOC_LIBRARY
|
||||
NAMES hwloc libhwloc
|
||||
HINTS ${LIBOMP_HWLOC_INSTALL_DIR}/lib)
|
||||
if(LIBOMP_HWLOC_LIBRARY)
|
||||
check_library_exists(${LIBOMP_HWLOC_LIBRARY} hwloc_topology_init
|
||||
${LIBOMP_HWLOC_INSTALL_DIR}/lib LIBOMP_HAVE_LIBHWLOC)
|
||||
get_filename_component(LIBOMP_HWLOC_LIBRARY_DIR ${LIBOMP_HWLOC_LIBRARY} PATH)
|
||||
endif()
|
||||
if(LIBOMP_HAVE_HWLOC_H AND LIBOMP_HAVE_LIBHWLOC AND LIBOMP_HWLOC_LIBRARY)
|
||||
set(LIBOMP_HAVE_HWLOC TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_HWLOC FALSE)
|
||||
libomp_say("Could not find hwloc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check if ThreadSanitizer support is available
|
||||
if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND ${INTEL64})
|
||||
set(LIBOMP_HAVE_TSAN_SUPPORT TRUE)
|
||||
else()
|
||||
set(LIBOMP_HAVE_TSAN_SUPPORT FALSE)
|
||||
endif()
|
||||
+11151
-7676
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
# identify the project. Note that if you do not use Doxywizard you need
|
||||
# to put quotes around the project name if it contains spaces.
|
||||
|
||||
PROJECT_NAME = "Intel® OpenMP* Runtime Library"
|
||||
PROJECT_NAME = "LLVM OpenMP* Runtime Library"
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
@@ -669,10 +669,10 @@ WARN_LOGFILE =
|
||||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = src doc/doxygen/libomp_interface.h
|
||||
INPUT = src doc/doxygen/libomp_interface.h
|
||||
# The ittnotify code also has doxygen documentation, but if we include it here
|
||||
# it takes over from us!
|
||||
# src/thirdparty/ittnotify
|
||||
# src/thirdparty/ittnotify
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
@@ -690,7 +690,7 @@ INPUT_ENCODING = UTF-8
|
||||
# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
|
||||
# *.f90 *.f *.for *.vhd *.vhdl
|
||||
|
||||
FILE_PATTERNS = *.c *.h *.cpp
|
||||
FILE_PATTERNS = *.c *.h *.cpp
|
||||
# We may also want to include the asm files with appropriate ifdef to ensure
|
||||
# doxygen doesn't see the content, just the documentation...
|
||||
|
||||
@@ -1539,7 +1539,7 @@ INCLUDE_FILE_PATTERNS =
|
||||
# undefined via #undef or recursively expanded use the := operator
|
||||
# instead of the = operator.
|
||||
|
||||
PREDEFINED = OMP_30_ENABLED=1, OMP_40_ENABLED=1
|
||||
PREDEFINED = OMP_30_ENABLED=1, OMP_40_ENABLED=1, KMP_STATS_ENABLED=1
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||
# this tag can be used to specify a list of macro names that should be expanded.
|
||||
@@ -1688,7 +1688,7 @@ UML_LOOK = NO
|
||||
# the class node. If there are many fields or methods and many nodes the
|
||||
# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
|
||||
# threshold limits the number of items for each type to make the size more
|
||||
# managable. Set this to 0 for no limit. Note that the threshold may be
|
||||
# manageable. Set this to 0 for no limit. Note that the threshold may be
|
||||
# exceeded by 50% before the limit is enforced.
|
||||
|
||||
UML_LIMIT_NUM_FIELDS = 10
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
\begin{titlepage}
|
||||
\vspace*{7cm}
|
||||
\begin{center}
|
||||
{\Large Intel\textsuperscript{\textregistered} OpenMP\textsuperscript{*} Runtime Library }\\
|
||||
{\Large LLVM OpenMP\textsuperscript{*} Runtime Library }\\
|
||||
\vspace*{1cm}
|
||||
{\large Generated by Doxygen $doxygenversion }\\
|
||||
\vspace*{0.5cm}
|
||||
@@ -59,31 +59,16 @@
|
||||
\end{center}
|
||||
\end{titlepage}
|
||||
|
||||
{\bf FTC Optimization Notice}
|
||||
\\
|
||||
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for
|
||||
optimizations that are not unique to Intel microprocessors. These optimizations include SSE2,
|
||||
SSE3, and SSE3 instruction sets and other optimizations. Intel does not guarantee the
|
||||
availability, functionality, or effectiveness of any optimization on microprocessors not
|
||||
manufactured by Intel.
|
||||
|
||||
Microprocessor-dependent optimizations in this product are intended for use with Intel
|
||||
microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for
|
||||
Intel microprocessors. Please refer to the applicable product User and Reference Guides for
|
||||
more information regarding the specific instruction sets covered by this notice.
|
||||
|
||||
Notice revision \#20110804
|
||||
|
||||
{\bf Trademarks}
|
||||
\\
|
||||
The OpenMP name and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board.
|
||||
|
||||
Intel, Xeon, and Intel Xeon Phi are trademarks of Intel Corporation in the U.S. and/or other countries.
|
||||
|
||||
This document is Copyright \textcopyright~\the\year the LLVM Project. It is
|
||||
subject to the same license terms as the LLVM OpenMP runtime.
|
||||
|
||||
\textsuperscript{*} Other names and brands may be claimed as the property of others.
|
||||
|
||||
The OpenMP name and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board.
|
||||
|
||||
This document is Copyright \textcopyright 2013, Intel Corporation. All rights reserved.
|
||||
|
||||
\clearemptydoublepage
|
||||
\pagenumbering{roman}
|
||||
\tableofcontents
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
/*! @mainpage Intel® OpenMP* Runtime Library Interface
|
||||
/*! @mainpage LLVM OpenMP* Runtime Library Interface
|
||||
@section sec_intro Introduction
|
||||
|
||||
This document describes the interface provided by the
|
||||
Intel® OpenMP\other runtime library to the compiler.
|
||||
LLVM OpenMP\other runtime library to the compiler.
|
||||
Routines that are directly called as simple functions by user code are
|
||||
not currently described here, since their definition is in the OpenMP
|
||||
specification available from http://openmp.org
|
||||
@@ -26,69 +26,32 @@ The aim here is to explain the interface from the compiler to the runtime.
|
||||
The overall design is described, and each function in the interface
|
||||
has its own description. (At least, that's the ambition, we may not be there yet).
|
||||
|
||||
@section sec_building Building the Runtime
|
||||
@section sec_building Quickly Building the Runtime
|
||||
For the impatient, we cover building the runtime as the first topic here.
|
||||
|
||||
A top-level Makefile is provided that attempts to derive a suitable
|
||||
configuration for the most commonly used environments. To see the
|
||||
default settings, type:
|
||||
CMake is used to build the OpenMP runtime. For details and a full list of options for the CMake build system,
|
||||
see <tt>Build_With_CMake.txt</tt> inside the <tt>runtime/</tt> subdirectory. These
|
||||
instructions will provide the most typical build.
|
||||
|
||||
In-LLVM-tree build:.
|
||||
@code
|
||||
% make info
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp into llvm/projects
|
||||
$ cd where-you-want-to-build
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/llvm -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make omp
|
||||
@endcode
|
||||
|
||||
You can change the Makefile's behavior with the following options:
|
||||
|
||||
- <b>omp_root</b>: The path to the top-level directory containing the top-level
|
||||
Makefile. By default, this will take on the value of the
|
||||
current working directory.
|
||||
|
||||
- <b>omp_os</b>: Operating system. By default, the build will attempt to
|
||||
detect this. Currently supports "linux", "macos", and
|
||||
"windows".
|
||||
|
||||
- <b>arch</b>: Architecture. By default, the build will attempt to
|
||||
detect this if not specified by the user. Currently
|
||||
supported values are
|
||||
- "32" for IA-32 architecture
|
||||
- "32e" for Intel® 64 architecture
|
||||
- "mic" for Intel® Many Integrated Core Architecture (
|
||||
If "mic" is specified then "icc" will be used as the
|
||||
compiler, and appropriate k1om binutils will be used. The
|
||||
necessary packages must be installed on the build machine
|
||||
for this to be possible, but an
|
||||
Intel® Xeon Phi™
|
||||
coprocessor is not required to build the library).
|
||||
|
||||
- <b>compiler</b>: Which compiler to use for the build. Defaults to "icc"
|
||||
or "icl" depending on the value of omp_os. Also supports
|
||||
"gcc" when omp_os is "linux" for gcc\other versions
|
||||
4.6.2 and higher. For icc on OS X\other, OS X\other versions
|
||||
greater than 10.6 are not supported currently. Also, icc
|
||||
version 13.0 is not supported. The selected compiler should be
|
||||
installed and in the user's path. The corresponding
|
||||
Fortran compiler should also be in the path.
|
||||
|
||||
- <b>mode</b>: Library mode: default is "release". Also supports "debug".
|
||||
|
||||
To use any of the options above, simple add <option_name>=<value>. For
|
||||
example, if you want to build with gcc instead of icc, type:
|
||||
Out-of-LLVM-tree build:
|
||||
@code
|
||||
% make compiler=gcc
|
||||
$ cd where-you-want-to-live
|
||||
Check out openmp
|
||||
$ cd where-you-want-to-live/openmp/runtime
|
||||
$ mkdir build && cd build
|
||||
$ cmake path/to/openmp -DCMAKE_C_COMPILER=<C compiler> -DCMAKE_CXX_COMPILER=<C++ compiler>
|
||||
$ make
|
||||
@endcode
|
||||
|
||||
Underneath the hood of the top-level Makefile, the runtime is built by
|
||||
a perl script that in turn drives a detailed runtime system make. The
|
||||
script can be found at <tt>tools/build.pl</tt>, and will print
|
||||
information about all its flags and controls if invoked as
|
||||
@code
|
||||
% tools/build.pl --help
|
||||
@endcode
|
||||
|
||||
If invoked with no arguments, it will try to build a set of libraries
|
||||
that are appropriate for the machine on which the build is happening.
|
||||
There are many options for building out of tree, and configuring library
|
||||
features that can also be used. Consult the <tt>--help</tt> output for details.
|
||||
|
||||
@section sec_supported Supported RTL Build Configurations
|
||||
|
||||
The architectures supported are IA-32 architecture, Intel® 64, and
|
||||
@@ -96,17 +59,39 @@ Intel® Many Integrated Core Architecture. The build configurations
|
||||
supported are shown in the table below.
|
||||
|
||||
<table border=1>
|
||||
<tr><th> <th>icc/icl<th>gcc
|
||||
<tr><td>Linux\other OS<td>Yes(1,5)<td>Yes(2,4)
|
||||
<tr><td>OS X\other<td>Yes(1,3,4)<td>No
|
||||
<tr><td>Windows\other OS<td>Yes(1,4)<td>No
|
||||
<tr><th> <th>icc/icl<th>gcc<th>clang
|
||||
<tr><td>Linux\other OS<td>Yes(1,5)<td>Yes(2,4)<td>Yes(4,6,7)
|
||||
<tr><td>FreeBSD\other<td>Yes(1,5)<td>Yes(2,4)<td>Yes(4,6,7,8)
|
||||
<tr><td>OS X\other<td>Yes(1,3,4)<td>No<td>Yes(4,6,7)
|
||||
<tr><td>Windows\other OS<td>Yes(1,4)<td>No<td>No
|
||||
</table>
|
||||
(1) On IA-32 architecture and Intel® 64, icc/icl versions 12.x
|
||||
are supported (12.1 is recommended).<br>
|
||||
(2) gcc version 4.6.2 is supported.<br>
|
||||
(2) gcc version 4.7 is supported.<br>
|
||||
(3) For icc on OS X\other, OS X\other version 10.5.8 is supported.<br>
|
||||
(4) Intel® Many Integrated Core Architecture not supported.<br>
|
||||
(5) On Intel® Many Integrated Core Architecture, icc/icl versions 13.0 or later are required.
|
||||
(5) On Intel® Many Integrated Core Architecture, icc/icl versions 13.0 or later are required.<br>
|
||||
(6) Clang\other version 3.3 is supported.<br>
|
||||
(7) Clang\other currently does not offer a software-implemented 128 bit extended
|
||||
precision type. Thus, all entry points reliant on this type are removed
|
||||
from the library and cannot be called in the user program. The following
|
||||
functions are not available:
|
||||
@code
|
||||
__kmpc_atomic_cmplx16_*
|
||||
__kmpc_atomic_float16_*
|
||||
__kmpc_atomic_*_fp
|
||||
@endcode
|
||||
(8) Community contribution provided AS IS, not tested by Intel.
|
||||
|
||||
Supported Architectures: IBM(R) Power 7 and Power 8
|
||||
<table border=1>
|
||||
<tr><th> <th>gcc<th>clang
|
||||
<tr><td>Linux\other OS<td>Yes(1,2)<td>Yes(3,4)
|
||||
</table>
|
||||
(1) On Power 7, gcc version 4.8.2 is supported.<br>
|
||||
(2) On Power 8, gcc version 4.8.2 is supported.<br>
|
||||
(3) On Power 7, clang version 3.7 is supported.<br>
|
||||
(4) On Power 8, clang version 3.7 is supported.<br>
|
||||
|
||||
@section sec_frontend Front-end Compilers that work with this RTL
|
||||
|
||||
@@ -208,6 +193,7 @@ are documented in different modules.
|
||||
- @ref THREADPRIVATE functions to support thread private data, copyin etc
|
||||
- @ref SYNCHRONIZATION functions to support `omp critical`, `omp barrier`, `omp master`, reductions etc
|
||||
- @ref ATOMIC_OPS functions to support atomic operations
|
||||
- @ref STATS_GATHERING macros to support developer profiling of libomp
|
||||
- Documentation on tasking has still to be written...
|
||||
|
||||
@section SEC_EXAMPLES Examples
|
||||
@@ -319,8 +305,29 @@ These functions are used for implementing barriers.
|
||||
@defgroup THREADPRIVATE Thread private data support
|
||||
These functions support copyin/out and thread private data.
|
||||
|
||||
@defgroup STATS_GATHERING Statistics Gathering from OMPTB
|
||||
These macros support profiling the libomp library. Use --stats=on when building with build.pl to enable
|
||||
and then use the KMP_* macros to profile (through counts or clock ticks) libomp during execution of an OpenMP program.
|
||||
|
||||
@section sec_stats_env_vars Environment Variables
|
||||
|
||||
This section describes the environment variables relevant to stats-gathering in libomp
|
||||
|
||||
@code
|
||||
KMP_STATS_FILE
|
||||
@endcode
|
||||
This environment variable is set to an output filename that will be appended *NOT OVERWRITTEN* if it exists. If this environment variable is undefined, the statistics will be output to stderr
|
||||
|
||||
@code
|
||||
KMP_STATS_THREADS
|
||||
@endcode
|
||||
This environment variable indicates to print thread-specific statistics as well as aggregate statistics. Each thread's statistics will be shown as well as the collective sum of all threads. The values "true", "on", "1", "yes" will all indicate to print per thread statistics.
|
||||
|
||||
@defgroup TASKING Tasking support
|
||||
These functions support are used to implement tasking constructs.
|
||||
These functions support tasking constructs.
|
||||
|
||||
@defgroup USER User visible functions
|
||||
These functions can be called directly by the user, but are runtime library specific, rather than being OpenMP interfaces.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
+317
-122
@@ -1,137 +1,332 @@
|
||||
set(OMP_SHLIBEXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
execute_process(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE BUILD_TIME)
|
||||
string(REGEX REPLACE "\n" "" BUILD_TIME ${BUILD_TIME})
|
||||
# Configure omp.h, kmp_config.h and ompt.h if necessary
|
||||
configure_file(${LIBOMP_INC_DIR}/omp.h.var omp.h @ONLY)
|
||||
configure_file(kmp_config.h.cmake kmp_config.h @ONLY)
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
configure_file(${LIBOMP_INC_DIR}/ompt.h.var ompt.h @ONLY)
|
||||
endif()
|
||||
|
||||
# Generate message catalog files: kmp_i18n_id.inc and kmp_i18n_default.inc
|
||||
add_custom_command(
|
||||
OUTPUT kmp_i18n_id.inc
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/message-converter.pl --os=${LIBOMP_PERL_SCRIPT_OS}
|
||||
--prefix=kmp_i18n --enum=kmp_i18n_id.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt
|
||||
DEPENDS ${LIBOMP_SRC_DIR}/i18n/en_US.txt ${LIBOMP_TOOLS_DIR}/message-converter.pl
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT kmp_i18n_default.inc
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/message-converter.pl --os=${LIBOMP_PERL_SCRIPT_OS}
|
||||
--prefix=kmp_i18n --default=kmp_i18n_default.inc ${LIBOMP_SRC_DIR}/i18n/en_US.txt
|
||||
DEPENDS ${LIBOMP_SRC_DIR}/i18n/en_US.txt ${LIBOMP_TOOLS_DIR}/message-converter.pl
|
||||
)
|
||||
|
||||
# Set the -D definitions for all sources
|
||||
# UNICODE and _UNICODE are set in LLVM's CMake system. They affect the
|
||||
# ittnotify code and should only be set when compiling ittnotify_static.c
|
||||
# on Windows (done below).
|
||||
# TODO: Fix the UNICODE usage in ittnotify code for Windows.
|
||||
remove_definitions(-DUNICODE -D_UNICODE)
|
||||
libomp_get_definitions_flags(LIBOMP_CONFIGURED_DEFINITIONS_FLAGS)
|
||||
add_definitions(${LIBOMP_CONFIGURED_DEFINITIONS_FLAGS})
|
||||
|
||||
# Set the -I includes for all sources
|
||||
include_directories(
|
||||
.
|
||||
include
|
||||
include/${OMP_VERSION}
|
||||
i18n
|
||||
thirdparty/ittnotify
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${LIBOMP_SRC_DIR}
|
||||
${LIBOMP_SRC_DIR}/i18n
|
||||
${LIBOMP_INC_DIR}
|
||||
${LIBOMP_SRC_DIR}/thirdparty/ittnotify
|
||||
)
|
||||
if(${LIBOMP_USE_HWLOC})
|
||||
include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(OS_GEN "win")
|
||||
elseif(APPLE)
|
||||
set(OS_GEN "mac")
|
||||
elseif(UNIX)
|
||||
set(OS_GEN "lin")
|
||||
# Getting correct source files to build library
|
||||
set(LIBOMP_CFILES)
|
||||
set(LIBOMP_CXXFILES)
|
||||
set(LIBOMP_ASMFILES)
|
||||
if(${STUBS_LIBRARY})
|
||||
set(LIBOMP_CFILES kmp_stub.cpp)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported OS")
|
||||
# Get C++ files
|
||||
set(LIBOMP_CXXFILES
|
||||
kmp_alloc.cpp
|
||||
kmp_atomic.cpp
|
||||
kmp_csupport.cpp
|
||||
kmp_debug.cpp
|
||||
kmp_itt.cpp
|
||||
kmp_environment.cpp
|
||||
kmp_error.cpp
|
||||
kmp_global.cpp
|
||||
kmp_i18n.cpp
|
||||
kmp_io.cpp
|
||||
kmp_runtime.cpp
|
||||
kmp_settings.cpp
|
||||
kmp_str.cpp
|
||||
kmp_tasking.cpp
|
||||
kmp_taskq.cpp
|
||||
kmp_threadprivate.cpp
|
||||
kmp_utility.cpp
|
||||
kmp_barrier.cpp
|
||||
kmp_wait_release.cpp
|
||||
kmp_affinity.cpp
|
||||
kmp_dispatch.cpp
|
||||
kmp_lock.cpp
|
||||
kmp_sched.cpp
|
||||
)
|
||||
if(WIN32)
|
||||
# Windows specific files
|
||||
libomp_append(LIBOMP_CXXFILES z_Windows_NT_util.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES z_Windows_NT-586_util.cpp)
|
||||
libomp_append(LIBOMP_ASMFILES z_Windows_NT-586_asm.asm) # Windows assembly file
|
||||
else()
|
||||
# Unix specific files
|
||||
libomp_append(LIBOMP_CXXFILES z_Linux_util.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_gsupport.cpp)
|
||||
libomp_append(LIBOMP_ASMFILES z_Linux_asm.S) # Unix assembly file
|
||||
endif()
|
||||
libomp_append(LIBOMP_CFILES thirdparty/ittnotify/ittnotify_static.c LIBOMP_USE_ITT_NOTIFY)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_debugger.cpp LIBOMP_USE_DEBUGGER)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_stats.cpp LIBOMP_STATS)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_stats_timing.cpp LIBOMP_STATS)
|
||||
if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_taskdeps.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_cancel.cpp)
|
||||
endif()
|
||||
endif()
|
||||
# Files common to stubs and normal library
|
||||
libomp_append(LIBOMP_CXXFILES kmp_ftn_cdecl.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_ftn_extra.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES kmp_version.cpp)
|
||||
libomp_append(LIBOMP_CXXFILES ompt-general.cpp IF_TRUE LIBOMP_OMPT_SUPPORT)
|
||||
libomp_append(LIBOMP_CXXFILES tsan_annotations.cpp IF_TRUE LIBOMP_TSAN_SUPPORT)
|
||||
|
||||
set(LIBOMP_SOURCE_FILES ${LIBOMP_CFILES} ${LIBOMP_CXXFILES} ${LIBOMP_ASMFILES})
|
||||
# For Windows, there is a resource file (.rc -> .res) that is also compiled
|
||||
libomp_append(LIBOMP_SOURCE_FILES libomp.rc WIN32)
|
||||
|
||||
# Get compiler and assembler flags
|
||||
libomp_get_cflags(LIBOMP_CONFIGURED_CFLAGS)
|
||||
libomp_get_cxxflags(LIBOMP_CONFIGURED_CXXFLAGS)
|
||||
libomp_get_asmflags(LIBOMP_CONFIGURED_ASMFLAGS)
|
||||
# Set the compiler flags for each type of source
|
||||
set_source_files_properties(${LIBOMP_CFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CFLAGS}")
|
||||
set_source_files_properties(${LIBOMP_CXXFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CXXFLAGS}")
|
||||
set_source_files_properties(${LIBOMP_ASMFILES} PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_ASMFLAGS}")
|
||||
# Let the compiler handle the assembly files on Unix-like systems
|
||||
if(NOT WIN32)
|
||||
set_source_files_properties(${LIBOMP_ASMFILES} PROPERTIES LANGUAGE C)
|
||||
endif()
|
||||
|
||||
if("${ARCH}" STREQUAL "")
|
||||
set(ARCH "32e")
|
||||
# Remove any cmake-automatic linking of the standard C++ library.
|
||||
# We neither need (nor want) the standard C++ library dependency even though we compile c++ files.
|
||||
if(NOT ${LIBOMP_USE_STDCPPLIB})
|
||||
set(LIBOMP_LINKER_LANGUAGE C)
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
|
||||
else()
|
||||
set(LIBOMP_LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
set(ARCH_STR "Intel(R) 64")
|
||||
# Add the OpenMP library
|
||||
libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS)
|
||||
|
||||
set(FEATURE_FLAGS "-D USE_ITT_BUILD")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D NDEBUG")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ARCH_STR=\"\\\"${ARCH_STR}\\\"\"")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D _GNU_SOURCE")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D _REENTRANT")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ASSERT")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_I8")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_TV")
|
||||
if(APPLE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -current_version 5.0")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -compatibility_version 5.0")
|
||||
add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
|
||||
|
||||
set_target_properties(omp PROPERTIES
|
||||
PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}"
|
||||
LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}"
|
||||
LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
|
||||
)
|
||||
|
||||
# Get the library's location within the build tree for the unit tester
|
||||
if(NOT WIN32)
|
||||
get_target_property(LIBOMP_LIBRARY_DIR omp LIBRARY_OUTPUT_DIRECTORY)
|
||||
else()
|
||||
get_target_property(LIBOMP_LIBRARY_DIR omp RUNTIME_OUTPUT_DIRECTORY)
|
||||
endif()
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_LIBRARY_FILE=\\\"libiomp5.${OMP_SHLIBEXT}\\\"")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_VERSION_MAJOR=${VERSION}")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D CACHE_LINE=64")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ADJUST_BLOCKTIME=1")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_PARALLEL_ORDERED")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ASM_INTRINS")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_LOAD_BALANCE")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_CBLKDATA")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D GUIDEDLL_EXPORTS")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_GOMP_COMPAT")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_50_ENABLED=0")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_41_ENABLED=0")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_40_ENABLED=1")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_30_ENABLED=1")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_ITT_NOTIFY=1")
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_")
|
||||
if (NOT APPLE)
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_TDATA_GTID")
|
||||
endif()
|
||||
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D _KMP_BUILD_TIME=\"\\\"${BUILD_TIME} UTC\\\"\"")
|
||||
|
||||
set(COMMON_FLAGS "-fPIC")
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-value")
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -Wno-switch")
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -Wno-deprecated-register")
|
||||
set(COMMON_FLAGS "${COMMON_FLAGS} -fno-exceptions")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FEATURE_FLAGS} ${COMMON_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FEATURE_FLAGS} ${COMMON_FLAGS}")
|
||||
|
||||
set(ASM_SOURCES
|
||||
z_Linux_asm.s
|
||||
)
|
||||
set(SOURCES
|
||||
thirdparty/ittnotify/ittnotify_static.c
|
||||
kmp_affinity.cpp
|
||||
kmp_alloc.c
|
||||
kmp_atomic.c
|
||||
kmp_cancel.cpp
|
||||
kmp_csupport.c
|
||||
kmp_debug.c
|
||||
kmp_dispatch.cpp
|
||||
kmp_environment.c
|
||||
kmp_error.c
|
||||
kmp_ftn_cdecl.c
|
||||
kmp_ftn_extra.c
|
||||
kmp_global.c
|
||||
kmp_gsupport.c
|
||||
kmp_i18n.c
|
||||
kmp_io.c
|
||||
kmp_itt.c
|
||||
kmp_lock.cpp
|
||||
kmp_runtime.c
|
||||
kmp_sched.cpp
|
||||
kmp_settings.c
|
||||
kmp_str.c
|
||||
kmp_taskdeps.cpp
|
||||
kmp_tasking.c
|
||||
kmp_taskq.c
|
||||
kmp_threadprivate.c
|
||||
kmp_utility.c
|
||||
kmp_version.c
|
||||
z_Linux_util.c
|
||||
)
|
||||
|
||||
set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)
|
||||
set_source_files_properties(${ASM_SOURCES} PROPERTIES LANGUAGE CXX)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT kmp_i18n_id.inc
|
||||
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/../tools/message-converter.pl --os=${OS_GEN} --arch=${ARCH} --prefix=kmp_i18n --enum=kmp_i18n_id.inc ${CMAKE_CURRENT_SOURCE_DIR}/i18n/en_US.txt
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT kmp_i18n_default.inc
|
||||
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/../tools/message-converter.pl --os=${OS_GEN} --arch=${ARCH} --prefix=kmp_i18n --default=kmp_i18n_default.inc ${CMAKE_CURRENT_SOURCE_DIR}/i18n/en_US.txt
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT omp.h
|
||||
COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/../tools/expand-vars.pl --strict -D Revision=\"\\$$Revision\" -D Date=\"\\$$Date\" -D KMP_TYPE=\"Performance\" -D KMP_ARCH=\"\\\"${ARCH_STR}\\\"\" -D KMP_VERSION_MAJOR=${VERSION} -D KMP_VERSION_MINOR=0 -D KMP_VERSION_BUILD=00000000 -D KMP_BUILD_DATE=\"${BUILD_TIME} UTC\" -D KMP_TARGET_COMPILER=12 -D KMP_DIAG=0 -D KMP_DEBUG_INFO=0 -D OMP_VERSION=${OMP_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/include/${OMP_VERSION_NUM}/omp.h.var omp.h
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT z_Linux_asm.o
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -c -o z_Linux_asm.o -D KMP_ASM_INTRINS -D KMP_GOMP_COMPAT -D KMP_ARCH_X86_64 -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SOURCES}
|
||||
)
|
||||
|
||||
add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc omp.h z_Linux_asm.o)
|
||||
|
||||
if(NOT APPLE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")
|
||||
if(NOT LIBOMP_LIBRARY_DIR)
|
||||
set(LIBOMP_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(LIBOMP_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
|
||||
else()
|
||||
set(LIBOMP_LIBRARY_DIR ${LIBOMP_LIBRARY_DIR} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Add symbolic links to libomp
|
||||
if(NOT WIN32)
|
||||
add_custom_command(TARGET omp POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${LIBOMP_LIB_FILE}
|
||||
libgomp${LIBOMP_LIBRARY_SUFFIX}
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${LIBOMP_LIB_FILE}
|
||||
libiomp5${LIBOMP_LIBRARY_SUFFIX}
|
||||
WORKING_DIRECTORY ${LIBOMP_LIBRARY_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
|
||||
libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
|
||||
target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${CMAKE_DL_LIBS})
|
||||
|
||||
# Create *.inc before compiling any sources
|
||||
# objects depend on : .inc files
|
||||
add_custom_target(libomp-needed-headers DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc)
|
||||
add_dependencies(omp libomp-needed-headers)
|
||||
|
||||
# Windows specific build rules
|
||||
if(WIN32)
|
||||
configure_file(libomp.rc.var libomp.rc @ONLY)
|
||||
|
||||
# Create .def and .rc file before compiling any sources
|
||||
add_custom_target(libomp-needed-windows-files DEPENDS ${LIBOMP_LIB_NAME}.def)
|
||||
add_dependencies(omp libomp-needed-windows-files)
|
||||
# z_Windows_NT-586_asm.asm requires definitions to be sent via command line
|
||||
# It only needs the architecutre macro and OMPT_SUPPORT=0|1
|
||||
libomp_append(LIBOMP_MASM_DEFINITIONS "-D_M_IA32" IF_TRUE IA32)
|
||||
libomp_append(LIBOMP_MASM_DEFINITIONS "-D_M_AMD64" IF_TRUE INTEL64)
|
||||
libomp_append(LIBOMP_MASM_DEFINITIONS "-DOMPT_SUPPORT" IF_TRUE_1_0 LIBOMP_OMPT_SUPPORT)
|
||||
libomp_list_to_string("${LIBOMP_MASM_DEFINITIONS}" LIBOMP_MASM_DEFINITIONS)
|
||||
set_property(SOURCE z_Windows_NT-586_asm.asm APPEND_STRING PROPERTY COMPILE_FLAGS " ${LIBOMP_MASM_DEFINITIONS}")
|
||||
set_source_files_properties(thirdparty/ittnotify/ittnotify_static.c PROPERTIES COMPILE_DEFINITIONS "UNICODE")
|
||||
|
||||
# Create Windows import library
|
||||
# the import library is "re-linked" to include kmp_import.cpp which prevents
|
||||
# linking of both Visual Studio OpenMP and newly built OpenMP
|
||||
set_source_files_properties(kmp_import.cpp PROPERTIES COMPILE_FLAGS "${LIBOMP_CONFIGURED_CFLAGS}")
|
||||
set(LIBOMP_IMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(LIBOMP_GENERATED_IMP_LIB_FILENAME ${LIBOMP_LIB_FILE}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set_target_properties(omp PROPERTIES
|
||||
VERSION ${LIBOMP_VERSION_MAJOR}.${LIBOMP_VERSION_MINOR} # uses /version flag
|
||||
IMPORT_PREFIX "" IMPORT_SUFFIX "" # control generated import library name when building omp
|
||||
ARCHIVE_OUTPUT_NAME ${LIBOMP_GENERATED_IMP_LIB_FILENAME}
|
||||
)
|
||||
# Get generated import library from creating omp
|
||||
get_target_property(LIBOMP_IMPORT_LIB_DIRECTORY omp ARCHIVE_OUTPUT_DIRECTORY)
|
||||
if(LIBOMP_IMPORT_LIB_DIRECTORY)
|
||||
set(LIBOMP_GENERATED_IMP_LIB ${LIBOMP_IMPORT_LIB_DIRECTORY}/${LIBOMP_GENERATED_IMP_LIB_FILENAME})
|
||||
else()
|
||||
set(LIBOMP_GENERATED_IMP_LIB ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_GENERATED_IMP_LIB_FILENAME})
|
||||
endif()
|
||||
set_source_files_properties(${LIBOMP_GENERATED_IMP_LIB} PROPERTIES GENERATED TRUE EXTERNAL_OBJECT TRUE)
|
||||
# Create new import library that is just the previously created one + kmp_import.cpp
|
||||
add_library(ompimp STATIC ${LIBOMP_GENERATED_IMP_LIB} kmp_import.cpp)
|
||||
set_target_properties(ompimp PROPERTIES
|
||||
PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}"
|
||||
LINKER_LANGUAGE C
|
||||
)
|
||||
add_dependencies(ompimp omp) # ensure generated import library is created first
|
||||
|
||||
# Create def file to designate exported functions
|
||||
libomp_get_gdflags(LIBOMP_GDFLAGS) # generate-def.pl flags (Windows only)
|
||||
libomp_string_to_list("${LIBOMP_GDFLAGS}" LIBOMP_GDFLAGS)
|
||||
add_custom_command(
|
||||
OUTPUT ${LIBOMP_LIB_NAME}.def
|
||||
COMMAND ${PERL_EXECUTABLE} ${LIBOMP_TOOLS_DIR}/generate-def.pl ${LIBOMP_GDFLAGS}
|
||||
-o ${LIBOMP_LIB_NAME}.def ${CMAKE_CURRENT_SOURCE_DIR}/dllexports
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dllexports ${LIBOMP_TOOLS_DIR}/generate-def.pl
|
||||
)
|
||||
endif()
|
||||
|
||||
# Building the Fortran module files
|
||||
# One compilation step creates both omp_lib.mod and omp_lib_kinds.mod
|
||||
if(${LIBOMP_FORTRAN_MODULES})
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.h.var omp_lib.h @ONLY)
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.f.var omp_lib.f @ONLY)
|
||||
configure_file(${LIBOMP_INC_DIR}/omp_lib.f90.var omp_lib.f90 @ONLY)
|
||||
add_custom_target(libomp-mod ALL DEPENDS omp_lib.mod omp_lib_kinds.mod)
|
||||
libomp_get_fflags(LIBOMP_CONFIGURED_FFLAGS)
|
||||
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||
set(LIBOMP_FORTRAN_SOURCE_FILE omp_lib.f90)
|
||||
else()
|
||||
set(LIBOMP_FORTRAN_SOURCE_FILE omp_lib.f)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT omp_lib.mod omp_lib_kinds.mod
|
||||
COMMAND ${CMAKE_Fortran_COMPILER} -c ${LIBOMP_CONFIGURED_FFLAGS} ${LIBOMP_FORTRAN_SOURCE_FILE}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${LIBOMP_FORTRAN_SOURCE_FILE}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
|
||||
)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES omp_lib${CMAKE_C_OUTPUT_EXTENSION})
|
||||
endif()
|
||||
|
||||
# Move files to exports/ directory if requested
|
||||
if(${LIBOMP_COPY_EXPORTS})
|
||||
include(LibompExports)
|
||||
endif()
|
||||
|
||||
# Micro test rules for after library has been built (cmake/LibompMicroTests.cmake)
|
||||
include(LibompMicroTests)
|
||||
add_custom_target(libomp-micro-tests)
|
||||
if(NOT ${MIC} AND NOT CMAKE_CROSSCOMPILING)
|
||||
add_dependencies(libomp-micro-tests libomp-test-touch)
|
||||
endif()
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_dependencies(libomp-micro-tests libomp-test-relo)
|
||||
endif()
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
add_dependencies(libomp-micro-tests libomp-test-execstack)
|
||||
endif()
|
||||
if(${MIC})
|
||||
add_dependencies(libomp-micro-tests libomp-test-instr)
|
||||
endif()
|
||||
add_dependencies(libomp-micro-tests libomp-test-deps)
|
||||
|
||||
# Install rules
|
||||
# We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
|
||||
# We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
|
||||
if(${LIBOMP_STANDALONE_BUILD})
|
||||
set(LIBOMP_HEADERS_INSTALL_PATH include)
|
||||
else()
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION})
|
||||
set(LIBOMP_HEADERS_INSTALL_PATH lib${LIBOMP_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
|
||||
endif()
|
||||
if(WIN32)
|
||||
install(TARGETS omp RUNTIME DESTINATION bin)
|
||||
install(TARGETS ompimp ARCHIVE DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
|
||||
# Create aliases (regular copies) of the library for backwards compatibility
|
||||
set(LIBOMP_ALIASES "libiomp5md")
|
||||
foreach(alias IN LISTS LIBOMP_ALIASES)
|
||||
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
|
||||
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
|
||||
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
|
||||
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
|
||||
endforeach()
|
||||
else()
|
||||
|
||||
install(TARGETS omp ${LIBOMP_INSTALL_KIND} DESTINATION lib${LIBOMP_LIBDIR_SUFFIX})
|
||||
|
||||
if(${LIBOMP_INSTALL_ALIASES})
|
||||
# Create aliases (symlinks) of the library for backwards compatibility
|
||||
set(LIBOMP_ALIASES "libgomp;libiomp5")
|
||||
foreach(alias IN LISTS LIBOMP_ALIASES)
|
||||
install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
|
||||
\"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
|
||||
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib${LIBOMP_LIBDIR_SUFFIX})")
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp.h
|
||||
DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
|
||||
)
|
||||
if(${LIBOMP_OMPT_SUPPORT})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ompt.h DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH})
|
||||
endif()
|
||||
if(${LIBOMP_FORTRAN_MODULES})
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp_lib.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp_lib.mod
|
||||
${CMAKE_CURRENT_BINARY_DIR}/omp_lib_kinds.mod
|
||||
DESTINATION ${LIBOMP_HEADERS_INSTALL_PATH}
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(iomp5 SHARED ${SOURCES} z_Linux_asm.o)
|
||||
add_dependencies(iomp5 gen_kmp_i18n)
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# defs.mk
|
||||
# $Revision: 42061 $
|
||||
# $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#//
|
||||
#// The LLVM Compiler Infrastructure
|
||||
#//
|
||||
#// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
#// Source Licenses. See LICENSE.txt for details.
|
||||
#//
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
# This file contains definitions common for OpenMP RTL and DSL makefiles.
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
|
||||
# Include really common definitions.
|
||||
include $(LIBOMP_WORK)tools/src/common-defs.mk
|
||||
|
||||
#
|
||||
# Directories.
|
||||
#
|
||||
|
||||
# Check and normalize LIBOMP_EXPORTS.
|
||||
ifeq "$(LIBOMP_EXPORTS)" ""
|
||||
$(error LIBOMP_EXPORTS environment variable must be set)
|
||||
endif
|
||||
ifneq "$(words $(LIBOMP_EXPORTS))" "1"
|
||||
$(error LIBOMP_EXPORTS must not contain spaces)
|
||||
endif
|
||||
override LIBOMP_EXPORTS := $(subst \,/,$(LIBOMP_EXPORTS))
|
||||
ifeq "$(filter %/,$(LIBOMP_EXPORTS))" ""
|
||||
override LIBOMP_EXPORTS := $(LIBOMP_EXPORTS)/
|
||||
endif
|
||||
# Output directories.
|
||||
out_dir = $(LIBOMP_EXPORTS)
|
||||
out_cmn_dir = $(out_dir)common$(suffix)/
|
||||
out_ptf_dir = $(out_dir)$(platform)$(suffix)/
|
||||
_out_lib_dir = $(out_dir)$(1)$(suffix)/lib$(if $(filter mac_%,$(1)),.thin)/
|
||||
out_lib_dir = $(call _out_lib_dir,$(platform))
|
||||
out_l10n_dir = $(out_lib_dir)$(if $(filter lin mac,$(os)),locale/)
|
||||
ifeq "$(os)" "mac"
|
||||
_out_lib_fat_dir = $(out_dir)$(1)$(suffix)/lib/
|
||||
out_lib_fat_dir = $(call _out_lib_fat_dir,$(platform))
|
||||
out_l10n_fat_dir = $(out_lib_fat_dir)locale/
|
||||
endif
|
||||
|
||||
#
|
||||
# Retrieve build number,
|
||||
#
|
||||
|
||||
ifeq "$(clean)" ""
|
||||
# Parse kmp_version.c file, look for "#define KMP_VERSION_BUILD yyyymmdd" string,
|
||||
# leave only "yyyymmdd". Note: Space after $$1 is important, it helps to detect possible errors.
|
||||
build := $(strip $(shell $(perl) -p -e '$$_ =~ s{^(?:\s*\#define\s+KMP_VERSION_BUILD\s+([0-9]{8})|.*)\s*\n}{$$1 }' $(LIBOMP_WORK)src/kmp_version.c))
|
||||
ifneq "$(words $(build))" "1"
|
||||
$(error Failed to pase "kmp_version.c", cannot extract build number)
|
||||
endif
|
||||
$(call say,Build : $(build)$(if $(filter 00000000,$(build)), (development)))
|
||||
endif
|
||||
|
||||
# end of file #
|
||||
+286
-14
@@ -160,14 +160,13 @@
|
||||
|
||||
# Regular entry points
|
||||
__kmp_wait_yield_4
|
||||
__kmp_wait_yield_8
|
||||
__kmp_wait_sleep
|
||||
__kmp_fork_call
|
||||
__kmp_invoke_microtask
|
||||
__kmp_release
|
||||
%ifdef KMP_USE_MONITOR
|
||||
__kmp_launch_monitor
|
||||
__kmp_launch_worker
|
||||
__kmp_reap_monitor
|
||||
%endif
|
||||
__kmp_launch_worker
|
||||
__kmp_reap_worker
|
||||
__kmp_acquire_tas_lock
|
||||
__kmp_acquire_nested_tas_lock
|
||||
@@ -184,13 +183,21 @@
|
||||
%endif
|
||||
|
||||
|
||||
%ifdef USE_DEBUGGER
|
||||
__kmp_debugging DATA
|
||||
__kmp_omp_debug_struct_info DATA
|
||||
%endif
|
||||
|
||||
# Symbols for MS mutual detection:
|
||||
_You_must_link_with_exactly_one_OpenMP_library DATA
|
||||
_You_must_link_with_Intel_OpenMP_library DATA
|
||||
%ifdef msvc_compat
|
||||
_You_must_link_with_Microsoft_OpenMP_library DATA
|
||||
%endif
|
||||
|
||||
__kmp_wait_64
|
||||
__kmp_release_64
|
||||
|
||||
# Symbols for MS mutual detection:
|
||||
_You_must_link_with_exactly_one_OpenMP_library DATA
|
||||
_You_must_link_with_Intel_OpenMP_library DATA
|
||||
%ifdef msvc_compat
|
||||
_You_must_link_with_Microsoft_OpenMP_library DATA
|
||||
%endif
|
||||
|
||||
# VT_getthid 1
|
||||
# vtgthid 2
|
||||
@@ -344,7 +351,7 @@ kmpc_set_defaults 224
|
||||
%ifdef OMP_30
|
||||
__kmpc_omp_taskyield 235
|
||||
%endif # OMP_30
|
||||
__kmpc_place_threads 236
|
||||
# __kmpc_place_threads 236
|
||||
%endif
|
||||
|
||||
# OpenMP 4.0 entry points
|
||||
@@ -360,9 +367,45 @@ kmpc_set_defaults 224
|
||||
__kmpc_cancel 244
|
||||
__kmpc_cancellationpoint 245
|
||||
__kmpc_cancel_barrier 246
|
||||
__kmpc_dist_for_static_init_4 247
|
||||
__kmpc_dist_for_static_init_4u 248
|
||||
__kmpc_dist_for_static_init_8 249
|
||||
__kmpc_dist_for_static_init_8u 250
|
||||
__kmpc_dist_dispatch_init_4 251
|
||||
__kmpc_dist_dispatch_init_4u 252
|
||||
__kmpc_dist_dispatch_init_8 253
|
||||
__kmpc_dist_dispatch_init_8u 254
|
||||
__kmpc_team_static_init_4 255
|
||||
__kmpc_team_static_init_4u 256
|
||||
__kmpc_team_static_init_8 257
|
||||
__kmpc_team_static_init_8u 258
|
||||
%endif # OMP_40
|
||||
%endif
|
||||
|
||||
# OpenMP 4.5 entry points
|
||||
%ifndef stub
|
||||
%ifdef OMP_45
|
||||
__kmpc_proxy_task_completed 259
|
||||
__kmpc_proxy_task_completed_ooo 260
|
||||
__kmpc_doacross_init 261
|
||||
__kmpc_doacross_wait 262
|
||||
__kmpc_doacross_post 263
|
||||
__kmpc_doacross_fini 264
|
||||
__kmpc_taskloop 266
|
||||
%endif
|
||||
%endif
|
||||
kmpc_aligned_malloc 265
|
||||
kmpc_set_disp_num_buffers 267
|
||||
|
||||
# OpenMP 5.0 entry points
|
||||
# TODO: change to OMP_50 once it is implemented
|
||||
%ifndef stub
|
||||
%ifdef OMP_45
|
||||
__kmpc_task_reduction_init 268
|
||||
__kmpc_task_reduction_get_th_data 269
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# User API entry points that have both lower- and upper- case versions for Fortran.
|
||||
# Number for lowercase version is indicated. Number for uppercase is obtained by adding 1000.
|
||||
# User API entry points are entry points that start with 'kmp_' or 'omp_'.
|
||||
@@ -414,6 +457,7 @@ kmp_get_num_known_threads 743
|
||||
kmp_set_stacksize_s 744
|
||||
kmp_get_stacksize_s 745
|
||||
kmp_set_defaults 746
|
||||
kmp_aligned_malloc 747
|
||||
kmp_set_warnings_on 779
|
||||
kmp_set_warnings_off 780
|
||||
|
||||
@@ -460,8 +504,40 @@ kmp_set_warnings_off 780
|
||||
omp_get_team_num 866
|
||||
omp_get_cancellation 867
|
||||
kmp_get_cancellation_status 868
|
||||
omp_is_initial_device 869
|
||||
omp_set_default_device 879
|
||||
omp_get_default_device 880
|
||||
%ifdef stub
|
||||
omp_get_num_devices 881
|
||||
%endif
|
||||
%endif # OMP_40
|
||||
|
||||
# OpenMP 45
|
||||
|
||||
%ifdef OMP_45
|
||||
omp_init_lock_with_hint 870
|
||||
omp_init_nest_lock_with_hint 871
|
||||
omp_get_max_task_priority 872
|
||||
omp_get_num_places 873
|
||||
omp_get_place_num_procs 874
|
||||
omp_get_place_proc_ids 875
|
||||
omp_get_place_num 876
|
||||
omp_get_partition_num_places 877
|
||||
omp_get_partition_place_nums 878
|
||||
%ifdef stub
|
||||
omp_get_initial_device 882
|
||||
omp_target_alloc 883
|
||||
omp_target_free 884
|
||||
omp_target_is_present 885
|
||||
omp_target_memcpy 886
|
||||
omp_target_memcpy_rect 887
|
||||
omp_target_associate_ptr 888
|
||||
omp_target_disassociate_ptr 889
|
||||
%endif
|
||||
%endif # OMP_45
|
||||
|
||||
kmp_set_disp_num_buffers 890
|
||||
|
||||
%ifndef stub
|
||||
# Ordinals between 900 and 999 are reserved
|
||||
|
||||
@@ -471,7 +547,9 @@ kmp_set_warnings_off 780
|
||||
|
||||
# ATOMIC entries
|
||||
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_div 2000
|
||||
%endif
|
||||
|
||||
__kmpc_atomic_fixed1_add 2001
|
||||
__kmpc_atomic_fixed1_andb 2002
|
||||
@@ -577,6 +655,7 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_cmplx10_sub 2094
|
||||
__kmpc_atomic_cmplx10_mul 2095
|
||||
__kmpc_atomic_cmplx10_div 2096
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_add 2097
|
||||
__kmpc_atomic_cmplx16_sub 2098
|
||||
__kmpc_atomic_cmplx16_mul 2099
|
||||
@@ -627,6 +706,7 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float10_sub_fp 2136
|
||||
__kmpc_atomic_float10_mul_fp 2137
|
||||
__kmpc_atomic_float10_div_fp 2138
|
||||
%endif
|
||||
|
||||
__kmpc_atomic_fixed1_mul_float8 2169
|
||||
__kmpc_atomic_fixed1_div_float8 2170
|
||||
@@ -661,6 +741,7 @@ kmp_set_warnings_off 780
|
||||
|
||||
%ifdef arch_32
|
||||
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_add_a16 2255
|
||||
__kmpc_atomic_float16_sub_a16 2256
|
||||
__kmpc_atomic_float16_mul_a16 2257
|
||||
@@ -672,6 +753,7 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_cmplx16_sub_a16 2262
|
||||
__kmpc_atomic_cmplx16_mul_a16 2263
|
||||
__kmpc_atomic_cmplx16_div_a16 2264
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
@@ -686,14 +768,18 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float4_rd 2269
|
||||
__kmpc_atomic_float8_rd 2270
|
||||
__kmpc_atomic_float10_rd 2271
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_rd 2272
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_rd 2273
|
||||
__kmpc_atomic_cmplx8_rd 2274
|
||||
__kmpc_atomic_cmplx10_rd 2275
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_rd 2276
|
||||
%ifdef arch_32
|
||||
__kmpc_atomic_float16_a16_rd 2277
|
||||
__kmpc_atomic_cmplx16_a16_rd 2278
|
||||
%ifdef arch_32
|
||||
__kmpc_atomic_float16_a16_rd 2277
|
||||
__kmpc_atomic_cmplx16_a16_rd 2278
|
||||
%endif
|
||||
%endif
|
||||
__kmpc_atomic_fixed1_wr 2279
|
||||
__kmpc_atomic_fixed2_wr 2280
|
||||
@@ -702,15 +788,19 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float4_wr 2283
|
||||
__kmpc_atomic_float8_wr 2284
|
||||
__kmpc_atomic_float10_wr 2285
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_wr 2286
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_wr 2287
|
||||
__kmpc_atomic_cmplx8_wr 2288
|
||||
__kmpc_atomic_cmplx10_wr 2289
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_wr 2290
|
||||
%ifdef arch_32
|
||||
__kmpc_atomic_float16_a16_wr 2291
|
||||
__kmpc_atomic_cmplx16_a16_wr 2292
|
||||
%endif
|
||||
%endif
|
||||
__kmpc_atomic_fixed1_add_cpt 2293
|
||||
__kmpc_atomic_fixed1_andb_cpt 2294
|
||||
__kmpc_atomic_fixed1_div_cpt 2295
|
||||
@@ -783,8 +873,10 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float4_min_cpt 2362
|
||||
__kmpc_atomic_float8_max_cpt 2363
|
||||
__kmpc_atomic_float8_min_cpt 2364
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_max_cpt 2365
|
||||
__kmpc_atomic_float16_min_cpt 2366
|
||||
%endif
|
||||
__kmpc_atomic_fixed1_neqv_cpt 2367
|
||||
__kmpc_atomic_fixed2_neqv_cpt 2368
|
||||
__kmpc_atomic_fixed4_neqv_cpt 2369
|
||||
@@ -797,10 +889,12 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float10_sub_cpt 2376
|
||||
__kmpc_atomic_float10_mul_cpt 2377
|
||||
__kmpc_atomic_float10_div_cpt 2378
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_add_cpt 2379
|
||||
__kmpc_atomic_float16_sub_cpt 2380
|
||||
__kmpc_atomic_float16_mul_cpt 2381
|
||||
__kmpc_atomic_float16_div_cpt 2382
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_add_cpt 2383
|
||||
__kmpc_atomic_cmplx4_sub_cpt 2384
|
||||
__kmpc_atomic_cmplx4_mul_cpt 2385
|
||||
@@ -813,13 +907,16 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_cmplx10_sub_cpt 2392
|
||||
__kmpc_atomic_cmplx10_mul_cpt 2393
|
||||
__kmpc_atomic_cmplx10_div_cpt 2394
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_add_cpt 2395
|
||||
__kmpc_atomic_cmplx16_sub_cpt 2396
|
||||
__kmpc_atomic_cmplx16_mul_cpt 2397
|
||||
__kmpc_atomic_cmplx16_div_cpt 2398
|
||||
%endif
|
||||
#__kmpc_atomic_cmplx4_add_cpt_tmp 2409
|
||||
|
||||
%ifdef arch_32
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_add_a16_cpt 2399
|
||||
__kmpc_atomic_float16_sub_a16_cpt 2400
|
||||
__kmpc_atomic_float16_mul_a16_cpt 2401
|
||||
@@ -831,10 +928,64 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_cmplx16_mul_a16_cpt 2407
|
||||
__kmpc_atomic_cmplx16_div_a16_cpt 2408
|
||||
%endif
|
||||
%endif
|
||||
|
||||
__kmpc_atomic_start 2410
|
||||
__kmpc_atomic_end 2411
|
||||
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_fixed1_add_cpt_fp
|
||||
__kmpc_atomic_fixed1_sub_cpt_fp
|
||||
__kmpc_atomic_fixed1_mul_cpt_fp
|
||||
__kmpc_atomic_fixed1_div_cpt_fp
|
||||
__kmpc_atomic_fixed1u_add_cpt_fp
|
||||
__kmpc_atomic_fixed1u_sub_cpt_fp
|
||||
__kmpc_atomic_fixed1u_mul_cpt_fp
|
||||
__kmpc_atomic_fixed1u_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_fixed2_add_cpt_fp
|
||||
__kmpc_atomic_fixed2_sub_cpt_fp
|
||||
__kmpc_atomic_fixed2_mul_cpt_fp
|
||||
__kmpc_atomic_fixed2_div_cpt_fp
|
||||
__kmpc_atomic_fixed2u_add_cpt_fp
|
||||
__kmpc_atomic_fixed2u_sub_cpt_fp
|
||||
__kmpc_atomic_fixed2u_mul_cpt_fp
|
||||
__kmpc_atomic_fixed2u_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_fixed4_add_cpt_fp
|
||||
__kmpc_atomic_fixed4_sub_cpt_fp
|
||||
__kmpc_atomic_fixed4_mul_cpt_fp
|
||||
__kmpc_atomic_fixed4_div_cpt_fp
|
||||
__kmpc_atomic_fixed4u_add_cpt_fp
|
||||
__kmpc_atomic_fixed4u_sub_cpt_fp
|
||||
__kmpc_atomic_fixed4u_mul_cpt_fp
|
||||
__kmpc_atomic_fixed4u_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_fixed8_add_cpt_fp
|
||||
__kmpc_atomic_fixed8_sub_cpt_fp
|
||||
__kmpc_atomic_fixed8_mul_cpt_fp
|
||||
__kmpc_atomic_fixed8_div_cpt_fp
|
||||
__kmpc_atomic_fixed8u_add_cpt_fp
|
||||
__kmpc_atomic_fixed8u_sub_cpt_fp
|
||||
__kmpc_atomic_fixed8u_mul_cpt_fp
|
||||
__kmpc_atomic_fixed8u_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_float4_add_cpt_fp
|
||||
__kmpc_atomic_float4_sub_cpt_fp
|
||||
__kmpc_atomic_float4_mul_cpt_fp
|
||||
__kmpc_atomic_float4_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_float8_add_cpt_fp
|
||||
__kmpc_atomic_float8_sub_cpt_fp
|
||||
__kmpc_atomic_float8_mul_cpt_fp
|
||||
__kmpc_atomic_float8_div_cpt_fp
|
||||
|
||||
__kmpc_atomic_float10_add_cpt_fp
|
||||
__kmpc_atomic_float10_sub_cpt_fp
|
||||
__kmpc_atomic_float10_mul_cpt_fp
|
||||
__kmpc_atomic_float10_div_cpt_fp
|
||||
%endif
|
||||
|
||||
%ifdef OMP_40
|
||||
|
||||
# ATOMIC extensions for OpenMP 4.0 spec (x86 and x64 only)
|
||||
@@ -846,16 +997,20 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float4_swp 2416
|
||||
__kmpc_atomic_float8_swp 2417
|
||||
__kmpc_atomic_float10_swp 2418
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_swp 2419
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_swp 2420
|
||||
__kmpc_atomic_cmplx8_swp 2421
|
||||
__kmpc_atomic_cmplx10_swp 2422
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_swp 2423
|
||||
|
||||
%ifdef arch_32
|
||||
__kmpc_atomic_float16_a16_swp 2424
|
||||
__kmpc_atomic_cmplx16_a16_swp 2425
|
||||
%endif
|
||||
%endif
|
||||
|
||||
__kmpc_atomic_fixed1_sub_cpt_rev 2426
|
||||
__kmpc_atomic_fixed1_div_cpt_rev 2427
|
||||
@@ -887,14 +1042,17 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_float8_div_cpt_rev 2453
|
||||
__kmpc_atomic_float10_sub_cpt_rev 2454
|
||||
__kmpc_atomic_float10_div_cpt_rev 2455
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_sub_cpt_rev 2456
|
||||
__kmpc_atomic_float16_div_cpt_rev 2457
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_sub_cpt_rev 2458
|
||||
__kmpc_atomic_cmplx4_div_cpt_rev 2459
|
||||
__kmpc_atomic_cmplx8_sub_cpt_rev 2460
|
||||
__kmpc_atomic_cmplx8_div_cpt_rev 2461
|
||||
__kmpc_atomic_cmplx10_sub_cpt_rev 2462
|
||||
__kmpc_atomic_cmplx10_div_cpt_rev 2463
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_sub_cpt_rev 2464
|
||||
__kmpc_atomic_cmplx16_div_cpt_rev 2465
|
||||
|
||||
@@ -904,12 +1062,126 @@ kmp_set_warnings_off 780
|
||||
__kmpc_atomic_cmplx16_sub_a16_cpt_rev 2468
|
||||
__kmpc_atomic_cmplx16_div_a16_cpt_rev 2469
|
||||
%endif
|
||||
%endif
|
||||
|
||||
__kmpc_atomic_fixed1_sub_rev 2470
|
||||
__kmpc_atomic_fixed1_div_rev 2471
|
||||
__kmpc_atomic_fixed1u_div_rev 2472
|
||||
__kmpc_atomic_fixed1_shl_rev 2473
|
||||
__kmpc_atomic_fixed1_shr_rev 2474
|
||||
__kmpc_atomic_fixed1u_shr_rev 2475
|
||||
__kmpc_atomic_fixed2_sub_rev 2476
|
||||
__kmpc_atomic_fixed2_div_rev 2477
|
||||
__kmpc_atomic_fixed2u_div_rev 2478
|
||||
__kmpc_atomic_fixed2_shl_rev 2479
|
||||
__kmpc_atomic_fixed2_shr_rev 2480
|
||||
__kmpc_atomic_fixed2u_shr_rev 2481
|
||||
__kmpc_atomic_fixed4_sub_rev 2482
|
||||
__kmpc_atomic_fixed4_div_rev 2483
|
||||
__kmpc_atomic_fixed4u_div_rev 2484
|
||||
__kmpc_atomic_fixed4_shl_rev 2485
|
||||
__kmpc_atomic_fixed4_shr_rev 2486
|
||||
__kmpc_atomic_fixed4u_shr_rev 2487
|
||||
__kmpc_atomic_fixed8_sub_rev 2488
|
||||
__kmpc_atomic_fixed8_div_rev 2489
|
||||
__kmpc_atomic_fixed8u_div_rev 2490
|
||||
__kmpc_atomic_fixed8_shl_rev 2491
|
||||
__kmpc_atomic_fixed8_shr_rev 2492
|
||||
__kmpc_atomic_fixed8u_shr_rev 2493
|
||||
__kmpc_atomic_float4_sub_rev 2494
|
||||
__kmpc_atomic_float4_div_rev 2495
|
||||
__kmpc_atomic_float8_sub_rev 2496
|
||||
__kmpc_atomic_float8_div_rev 2497
|
||||
__kmpc_atomic_float10_sub_rev 2498
|
||||
__kmpc_atomic_float10_div_rev 2499
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_float16_sub_rev 2500
|
||||
__kmpc_atomic_float16_div_rev 2501
|
||||
%endif
|
||||
__kmpc_atomic_cmplx4_sub_rev 2502
|
||||
__kmpc_atomic_cmplx4_div_rev 2503
|
||||
__kmpc_atomic_cmplx8_sub_rev 2504
|
||||
__kmpc_atomic_cmplx8_div_rev 2505
|
||||
__kmpc_atomic_cmplx10_sub_rev 2506
|
||||
__kmpc_atomic_cmplx10_div_rev 2507
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_cmplx16_sub_rev 2508
|
||||
__kmpc_atomic_cmplx16_div_rev 2509
|
||||
%ifdef arch_32
|
||||
__kmpc_atomic_float16_sub_a16_rev 2510
|
||||
__kmpc_atomic_float16_div_a16_rev 2511
|
||||
__kmpc_atomic_cmplx16_sub_a16_rev 2512
|
||||
__kmpc_atomic_cmplx16_div_a16_rev 2513
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_fixed1_sub_rev_fp
|
||||
__kmpc_atomic_fixed1u_sub_rev_fp
|
||||
__kmpc_atomic_fixed1_div_rev_fp
|
||||
__kmpc_atomic_fixed1u_div_rev_fp
|
||||
__kmpc_atomic_fixed2_sub_rev_fp
|
||||
__kmpc_atomic_fixed2u_sub_rev_fp
|
||||
__kmpc_atomic_fixed2_div_rev_fp
|
||||
__kmpc_atomic_fixed2u_div_rev_fp
|
||||
__kmpc_atomic_fixed4_sub_rev_fp
|
||||
__kmpc_atomic_fixed4u_sub_rev_fp
|
||||
__kmpc_atomic_fixed4_div_rev_fp
|
||||
__kmpc_atomic_fixed4u_div_rev_fp
|
||||
__kmpc_atomic_fixed8_sub_rev_fp
|
||||
__kmpc_atomic_fixed8u_sub_rev_fp
|
||||
__kmpc_atomic_fixed8_div_rev_fp
|
||||
__kmpc_atomic_fixed8u_div_rev_fp
|
||||
__kmpc_atomic_float4_sub_rev_fp
|
||||
__kmpc_atomic_float4_div_rev_fp
|
||||
__kmpc_atomic_float8_sub_rev_fp
|
||||
__kmpc_atomic_float8_div_rev_fp
|
||||
__kmpc_atomic_float10_sub_rev_fp
|
||||
__kmpc_atomic_float10_div_rev_fp
|
||||
|
||||
__kmpc_atomic_fixed1_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed1u_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed1_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed1u_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed2_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed2u_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed2_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed2u_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed4_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed4u_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed4_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed4u_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed8_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed8u_sub_cpt_rev_fp
|
||||
__kmpc_atomic_fixed8_div_cpt_rev_fp
|
||||
__kmpc_atomic_fixed8u_div_cpt_rev_fp
|
||||
__kmpc_atomic_float4_sub_cpt_rev_fp
|
||||
__kmpc_atomic_float4_div_cpt_rev_fp
|
||||
__kmpc_atomic_float8_sub_cpt_rev_fp
|
||||
__kmpc_atomic_float8_div_cpt_rev_fp
|
||||
__kmpc_atomic_float10_sub_cpt_rev_fp
|
||||
__kmpc_atomic_float10_div_cpt_rev_fp
|
||||
%endif
|
||||
%endif # OMP_40
|
||||
|
||||
|
||||
%endif # arch_64
|
||||
|
||||
%ifdef HAVE_QUAD
|
||||
__kmpc_atomic_fixed1u_add_fp
|
||||
__kmpc_atomic_fixed1u_sub_fp
|
||||
__kmpc_atomic_fixed1u_mul_fp
|
||||
__kmpc_atomic_fixed2u_add_fp
|
||||
__kmpc_atomic_fixed2u_sub_fp
|
||||
__kmpc_atomic_fixed2u_mul_fp
|
||||
__kmpc_atomic_fixed4u_add_fp
|
||||
__kmpc_atomic_fixed4u_sub_fp
|
||||
__kmpc_atomic_fixed4u_mul_fp
|
||||
__kmpc_atomic_fixed8u_add_fp
|
||||
__kmpc_atomic_fixed8u_sub_fp
|
||||
__kmpc_atomic_fixed8u_mul_fp
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
# end of file #
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#//===----------------------------------------------------------------------===//
|
||||
#
|
||||
|
||||
# This is version script for OMP RTL shared library (libiomp5*.so)
|
||||
# This is version script for OMP RTL shared library (libomp*.so)
|
||||
|
||||
VERSION {
|
||||
|
||||
@@ -21,6 +21,25 @@ VERSION {
|
||||
# "Normal" symbols.
|
||||
#
|
||||
omp_*; # Standard OpenMP functions.
|
||||
|
||||
#
|
||||
# OMPT API
|
||||
#
|
||||
ompt_tool; # OMPT initialization interface
|
||||
ompt_control; # OMPT control interface
|
||||
|
||||
# icc drops weak attribute at linking step without the following line:
|
||||
Annotate*; # TSAN annotation
|
||||
|
||||
#
|
||||
# OMPT state placeholders
|
||||
#
|
||||
ompt_idle;
|
||||
ompt_overhead;
|
||||
ompt_barrier_wait;
|
||||
ompt_task_wait;
|
||||
ompt_mutex_wait;
|
||||
|
||||
ompc_*; # omp.h renames some standard functions to ompc_*.
|
||||
kmp_*; # Intel extensions.
|
||||
kmpc_*; # Intel extensions.
|
||||
@@ -30,6 +49,13 @@ VERSION {
|
||||
_You_must_link_with_*; # Mutual detection/MS compatibility symbols.
|
||||
|
||||
|
||||
#
|
||||
# Debugger support.
|
||||
#
|
||||
#if USE_DEBUGGER
|
||||
__kmp_debugging;
|
||||
__kmp_omp_debug_struct_info;
|
||||
#endif /* USE_DEBUGGER */
|
||||
|
||||
#
|
||||
# Internal functions exported for testing purposes.
|
||||
@@ -40,6 +66,8 @@ VERSION {
|
||||
__kmp_thread_pool;
|
||||
__kmp_thread_pool_nth;
|
||||
|
||||
__kmp_reset_stats;
|
||||
|
||||
#if USE_ITT_BUILD
|
||||
#
|
||||
# ITT support.
|
||||
@@ -56,18 +84,16 @@ VERSION {
|
||||
__kmp_acquire_tas_lock;
|
||||
__kmp_acquire_ticket_lock;
|
||||
__kmp_fork_call;
|
||||
__kmp_get_reduce_method;
|
||||
__kmp_invoke_microtask;
|
||||
__kmp_itt_fini_ittlib;
|
||||
__kmp_itt_init_ittlib;
|
||||
#if KMP_USE_MONITOR
|
||||
__kmp_launch_monitor;
|
||||
__kmp_launch_worker;
|
||||
__kmp_reap_monitor;
|
||||
#endif
|
||||
__kmp_launch_worker;
|
||||
__kmp_reap_worker;
|
||||
__kmp_release;
|
||||
__kmp_wait_sleep;
|
||||
__kmp_release_64;
|
||||
__kmp_wait_64;
|
||||
__kmp_wait_yield_4;
|
||||
__kmp_wait_yield_8;
|
||||
|
||||
# ittnotify symbols to be used by debugger
|
||||
__kmp_itt_fini_ittlib;
|
||||
|
||||
+390
-403
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* extractExternal.cpp
|
||||
* $Revision: 42181 $
|
||||
* $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
|
||||
*/
|
||||
|
||||
|
||||
@@ -15,13 +13,13 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <strstream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <strstream>
|
||||
|
||||
/* Given a set of n object files h ('external' object files) and a set of m
|
||||
object files o ('internal' object files),
|
||||
@@ -32,468 +30,457 @@
|
||||
Usage:
|
||||
hide.exe <n> <filenames for h> <filenames for o>
|
||||
|
||||
Thus, the prefixed symbols become hidden in the sense that they now have a special
|
||||
prefix.
|
||||
Thus, the prefixed symbols become hidden in the sense that they now have a
|
||||
special prefix.
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
|
||||
void stop(char* errorMsg) {
|
||||
printf("%s\n", errorMsg);
|
||||
exit(1);
|
||||
void stop(char *errorMsg) {
|
||||
printf("%s\n", errorMsg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// an entry in the symbol table of a .OBJ file
|
||||
class Symbol {
|
||||
public:
|
||||
__int64 name;
|
||||
unsigned value;
|
||||
unsigned short sectionNum, type;
|
||||
char storageClass, nAux;
|
||||
__int64 name;
|
||||
unsigned value;
|
||||
unsigned short sectionNum, type;
|
||||
char storageClass, nAux;
|
||||
};
|
||||
|
||||
class _rstream : public istrstream {
|
||||
private:
|
||||
const char *buf;
|
||||
const char *buf;
|
||||
|
||||
protected:
|
||||
_rstream(pair<const char*, streamsize> p):istrstream(p.first,p.second),buf(p.first){}
|
||||
~_rstream() {
|
||||
delete[]buf;
|
||||
}
|
||||
_rstream(pair<const char *, streamsize> p)
|
||||
: istrstream(p.first, p.second), buf(p.first) {}
|
||||
~_rstream() { delete[] buf; }
|
||||
};
|
||||
|
||||
/* A stream encapuslating the content of a file or the content of a string, overriding the
|
||||
>> operator to read various integer types in binary form, as well as a symbol table
|
||||
entry.
|
||||
*/
|
||||
// A stream encapuslating the content of a file or the content of a string,
|
||||
// overriding the >> operator to read various integer types in binary form,
|
||||
// as well as a symbol table entry.
|
||||
class rstream : public _rstream {
|
||||
private:
|
||||
template<class T>
|
||||
inline rstream& doRead(T &x) {
|
||||
read((char*)&x, sizeof(T));
|
||||
return *this;
|
||||
}
|
||||
static pair<const char*, streamsize> getBuf(const char *fileName) {
|
||||
ifstream raw(fileName,ios::binary | ios::in);
|
||||
if(!raw.is_open())
|
||||
stop("rstream.getBuf: Error opening file");
|
||||
raw.seekg(0,ios::end);
|
||||
streampos fileSize = raw.tellg();
|
||||
if(fileSize < 0)
|
||||
stop("rstream.getBuf: Error reading file");
|
||||
char *buf = new char[fileSize];
|
||||
raw.seekg(0,ios::beg);
|
||||
raw.read(buf, fileSize);
|
||||
return pair<const char*, streamsize>(buf,fileSize);
|
||||
}
|
||||
template <class T> inline rstream &doRead(T &x) {
|
||||
read((char *)&x, sizeof(T));
|
||||
return *this;
|
||||
}
|
||||
static pair<const char *, streamsize> getBuf(const char *fileName) {
|
||||
ifstream raw(fileName, ios::binary | ios::in);
|
||||
if (!raw.is_open())
|
||||
stop("rstream.getBuf: Error opening file");
|
||||
raw.seekg(0, ios::end);
|
||||
streampos fileSize = raw.tellg();
|
||||
if (fileSize < 0)
|
||||
stop("rstream.getBuf: Error reading file");
|
||||
char *buf = new char[fileSize];
|
||||
raw.seekg(0, ios::beg);
|
||||
raw.read(buf, fileSize);
|
||||
return pair<const char *, streamsize>(buf, fileSize);
|
||||
}
|
||||
|
||||
public:
|
||||
// construct from a string
|
||||
rstream(const char *buf,streamsize size):_rstream(pair<const char*,streamsize>(buf, size)){}
|
||||
/* construct from a file whole content is fully read once to initialize the content of
|
||||
this stream
|
||||
*/
|
||||
rstream(const char *fileName):_rstream(getBuf(fileName)){}
|
||||
rstream& operator>>(int &x) {
|
||||
return doRead(x);
|
||||
}
|
||||
rstream& operator>>(unsigned &x) {
|
||||
return doRead(x);
|
||||
}
|
||||
rstream& operator>>(short &x) {
|
||||
return doRead(x);
|
||||
}
|
||||
rstream& operator>>(unsigned short &x) {
|
||||
return doRead(x);
|
||||
}
|
||||
rstream& operator>>(Symbol &e) {
|
||||
read((char*)&e, 18);
|
||||
return *this;
|
||||
}
|
||||
// construct from a string
|
||||
rstream(const char *buf, streamsize size)
|
||||
: _rstream(pair<const char *, streamsize>(buf, size)) {}
|
||||
// construct from a file whole content is fully read once to initialize the
|
||||
// content of this stream
|
||||
rstream(const char *fileName) : _rstream(getBuf(fileName)) {}
|
||||
rstream &operator>>(int &x) { return doRead(x); }
|
||||
rstream &operator>>(unsigned &x) { return doRead(x); }
|
||||
rstream &operator>>(short &x) { return doRead(x); }
|
||||
rstream &operator>>(unsigned short &x) { return doRead(x); }
|
||||
rstream &operator>>(Symbol &e) {
|
||||
read((char *)&e, 18);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
// string table in a .OBJ file
|
||||
class StringTable {
|
||||
private:
|
||||
map<string, unsigned> directory;
|
||||
size_t length;
|
||||
char *data;
|
||||
map<string, unsigned> directory;
|
||||
size_t length;
|
||||
char *data;
|
||||
|
||||
// make <directory> from <length> bytes in <data>
|
||||
void makeDirectory(void) {
|
||||
unsigned i = 4;
|
||||
while(i < length) {
|
||||
string s = string(data + i);
|
||||
directory.insert(make_pair(s, i));
|
||||
i += s.size() + 1;
|
||||
}
|
||||
// make <directory> from <length> bytes in <data>
|
||||
void makeDirectory(void) {
|
||||
unsigned i = 4;
|
||||
while (i < length) {
|
||||
string s = string(data + i);
|
||||
directory.insert(make_pair(s, i));
|
||||
i += s.size() + 1;
|
||||
}
|
||||
// initialize <length> and <data> with contents specified by the arguments
|
||||
void init(const char *_data) {
|
||||
unsigned _length = *(unsigned*)_data;
|
||||
}
|
||||
// initialize <length> and <data> with contents specified by the arguments
|
||||
void init(const char *_data) {
|
||||
unsigned _length = *(unsigned *)_data;
|
||||
|
||||
if(_length < sizeof(unsigned) || _length != *(unsigned*)_data)
|
||||
stop("StringTable.init: Invalid symbol table");
|
||||
if(_data[_length - 1]) {
|
||||
// to prevent runaway strings, make sure the data ends with a zero
|
||||
data = new char[length = _length + 1];
|
||||
data[_length] = 0;
|
||||
} else {
|
||||
data = new char[length = _length];
|
||||
}
|
||||
*(unsigned*)data = length;
|
||||
memcpy(data + sizeof(unsigned), _data + sizeof(unsigned),
|
||||
length - sizeof(unsigned));
|
||||
makeDirectory();
|
||||
if (_length < sizeof(unsigned) || _length != *(unsigned *)_data)
|
||||
stop("StringTable.init: Invalid symbol table");
|
||||
if (_data[_length - 1]) {
|
||||
// to prevent runaway strings, make sure the data ends with a zero
|
||||
data = new char[length = _length + 1];
|
||||
data[_length] = 0;
|
||||
} else {
|
||||
data = new char[length = _length];
|
||||
}
|
||||
*(unsigned *)data = length;
|
||||
KMP_MEMCPY(data + sizeof(unsigned), _data + sizeof(unsigned),
|
||||
length - sizeof(unsigned));
|
||||
makeDirectory();
|
||||
}
|
||||
|
||||
public:
|
||||
StringTable(rstream &f) {
|
||||
/* Construct string table by reading from f.
|
||||
*/
|
||||
streampos s;
|
||||
unsigned strSize;
|
||||
char *strData;
|
||||
StringTable(rstream &f) {
|
||||
// Construct string table by reading from f.
|
||||
streampos s;
|
||||
unsigned strSize;
|
||||
char *strData;
|
||||
|
||||
s = f.tellg();
|
||||
f>>strSize;
|
||||
if(strSize < sizeof(unsigned))
|
||||
stop("StringTable: Invalid string table");
|
||||
strData = new char[strSize];
|
||||
*(unsigned*)strData = strSize;
|
||||
// read the raw data into <strData>
|
||||
f.read(strData + sizeof(unsigned), strSize - sizeof(unsigned));
|
||||
s = f.tellg() - s;
|
||||
if(s < strSize)
|
||||
stop("StringTable: Unexpected EOF");
|
||||
init(strData);
|
||||
delete[]strData;
|
||||
}
|
||||
StringTable(const set<string> &strings) {
|
||||
/* Construct string table from given strings.
|
||||
*/
|
||||
char *p;
|
||||
set<string>::const_iterator it;
|
||||
size_t s;
|
||||
s = f.tellg();
|
||||
f >> strSize;
|
||||
if (strSize < sizeof(unsigned))
|
||||
stop("StringTable: Invalid string table");
|
||||
strData = new char[strSize];
|
||||
*(unsigned *)strData = strSize;
|
||||
// read the raw data into <strData>
|
||||
f.read(strData + sizeof(unsigned), strSize - sizeof(unsigned));
|
||||
s = f.tellg() - s;
|
||||
if (s < strSize)
|
||||
stop("StringTable: Unexpected EOF");
|
||||
init(strData);
|
||||
delete[] strData;
|
||||
}
|
||||
StringTable(const set<string> &strings) {
|
||||
// Construct string table from given strings.
|
||||
char *p;
|
||||
set<string>::const_iterator it;
|
||||
size_t s;
|
||||
|
||||
// count required size for data
|
||||
for(length = sizeof(unsigned), it = strings.begin(); it != strings.end(); ++it) {
|
||||
size_t l = (*it).size();
|
||||
// count required size for data
|
||||
for (length = sizeof(unsigned), it = strings.begin(); it != strings.end();
|
||||
++it) {
|
||||
size_t l = (*it).size();
|
||||
|
||||
if(l > (unsigned) 0xFFFFFFFF)
|
||||
stop("StringTable: String too long");
|
||||
if(l > 8) {
|
||||
length += l + 1;
|
||||
if(length > (unsigned) 0xFFFFFFFF)
|
||||
stop("StringTable: Symbol table too long");
|
||||
}
|
||||
}
|
||||
data = new char[length];
|
||||
*(unsigned*)data = length;
|
||||
// populate data and directory
|
||||
for(p = data + sizeof(unsigned), it = strings.begin(); it != strings.end(); ++it) {
|
||||
const string &str = *it;
|
||||
size_t l = str.size();
|
||||
if(l > 8) {
|
||||
directory.insert(make_pair(str, p - data));
|
||||
memcpy(p, str.c_str(), l);
|
||||
p[l] = 0;
|
||||
p += l + 1;
|
||||
}
|
||||
}
|
||||
if (l > (unsigned)0xFFFFFFFF)
|
||||
stop("StringTable: String too long");
|
||||
if (l > 8) {
|
||||
length += l + 1;
|
||||
if (length > (unsigned)0xFFFFFFFF)
|
||||
stop("StringTable: Symbol table too long");
|
||||
}
|
||||
}
|
||||
~StringTable() {
|
||||
delete[] data;
|
||||
data = new char[length];
|
||||
*(unsigned *)data = length;
|
||||
// populate data and directory
|
||||
for (p = data + sizeof(unsigned), it = strings.begin(); it != strings.end();
|
||||
++it) {
|
||||
const string &str = *it;
|
||||
size_t l = str.size();
|
||||
if (l > 8) {
|
||||
directory.insert(make_pair(str, p - data));
|
||||
KMP_MEMCPY(p, str.c_str(), l);
|
||||
p[l] = 0;
|
||||
p += l + 1;
|
||||
}
|
||||
}
|
||||
/* Returns encoding for given string based on this string table.
|
||||
Error if string length is greater than 8 but string is not in
|
||||
the string table--returns 0.
|
||||
*/
|
||||
__int64 encode(const string &str) {
|
||||
__int64 r;
|
||||
}
|
||||
~StringTable() { delete[] data; }
|
||||
// Returns encoding for given string based on this string table. Error if
|
||||
// string length is greater than 8 but string is not in the string table
|
||||
// -- returns 0.
|
||||
__int64 encode(const string &str) {
|
||||
__int64 r;
|
||||
|
||||
if(str.size() <= 8) {
|
||||
// encoded directly
|
||||
((char*)&r)[7] = 0;
|
||||
strncpy((char*)&r, str.c_str(), 8);
|
||||
return r;
|
||||
} else {
|
||||
// represented as index into table
|
||||
map<string,unsigned>::const_iterator it = directory.find(str);
|
||||
if(it == directory.end())
|
||||
stop("StringTable::encode: String now found in string table");
|
||||
((unsigned*)&r)[0] = 0;
|
||||
((unsigned*)&r)[1] = (*it).second;
|
||||
return r;
|
||||
}
|
||||
if (str.size() <= 8) {
|
||||
// encoded directly
|
||||
((char *)&r)[7] = 0;
|
||||
KMP_STRNCPY_S((char *)&r, sizeof(r), str.c_str(), 8);
|
||||
return r;
|
||||
} else {
|
||||
// represented as index into table
|
||||
map<string, unsigned>::const_iterator it = directory.find(str);
|
||||
if (it == directory.end())
|
||||
stop("StringTable::encode: String now found in string table");
|
||||
((unsigned *)&r)[0] = 0;
|
||||
((unsigned *)&r)[1] = (*it).second;
|
||||
return r;
|
||||
}
|
||||
/* Returns string represented by x based on this string table.
|
||||
Error if x references an invalid position in the table--returns
|
||||
the empty string.
|
||||
*/
|
||||
string decode(__int64 x) const {
|
||||
if(*(unsigned*)&x == 0) {
|
||||
// represented as index into table
|
||||
unsigned &p = ((unsigned*)&x)[1];
|
||||
if(p >= length)
|
||||
stop("StringTable::decode: Invalid string table lookup");
|
||||
return string(data + p);
|
||||
} else {
|
||||
// encoded directly
|
||||
char *p = (char*)&x;
|
||||
int i;
|
||||
}
|
||||
// Returns string represented by x based on this string table. Error if x
|
||||
// references an invalid position in the table--returns the empty string.
|
||||
string decode(__int64 x) const {
|
||||
if (*(unsigned *)&x == 0) {
|
||||
// represented as index into table
|
||||
unsigned &p = ((unsigned *)&x)[1];
|
||||
if (p >= length)
|
||||
stop("StringTable::decode: Invalid string table lookup");
|
||||
return string(data + p);
|
||||
} else {
|
||||
// encoded directly
|
||||
char *p = (char *)&x;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 8 && p[i]; ++i);
|
||||
return string(p, i);
|
||||
}
|
||||
}
|
||||
void write(ostream &os) {
|
||||
os.write(data, length);
|
||||
for (i = 0; i < 8 && p[i]; ++i)
|
||||
;
|
||||
return string(p, i);
|
||||
}
|
||||
}
|
||||
void write(ostream &os) { os.write(data, length); }
|
||||
};
|
||||
|
||||
/* for the named object file, determines the set of defined symbols and the set of undefined external symbols
|
||||
and writes them to <defined> and <undefined> respectively
|
||||
*/
|
||||
void computeExternalSymbols(const char *fileName, set<string> *defined, set<string> *undefined){
|
||||
streampos fileSize;
|
||||
size_t strTabStart;
|
||||
unsigned symTabStart, symNEntries;
|
||||
rstream f(fileName);
|
||||
// for the named object file, determines the set of defined symbols and the set
|
||||
// of undefined external symbols and writes them to <defined> and <undefined>
|
||||
// respectively
|
||||
void computeExternalSymbols(const char *fileName, set<string> *defined,
|
||||
set<string> *undefined) {
|
||||
streampos fileSize;
|
||||
size_t strTabStart;
|
||||
unsigned symTabStart, symNEntries;
|
||||
rstream f(fileName);
|
||||
|
||||
f.seekg(0,ios::end);
|
||||
fileSize = f.tellg();
|
||||
f.seekg(0, ios::end);
|
||||
fileSize = f.tellg();
|
||||
|
||||
f.seekg(8);
|
||||
f >> symTabStart >> symNEntries;
|
||||
// seek to the string table
|
||||
f.seekg(strTabStart = symTabStart + 18 * (size_t)symNEntries);
|
||||
if(f.eof()) {
|
||||
printf("computeExternalSymbols: fileName='%s', fileSize = %lu, symTabStart = %u, symNEntries = %u\n",
|
||||
fileName, (unsigned long) fileSize, symTabStart, symNEntries);
|
||||
stop("computeExternalSymbols: Unexpected EOF 1");
|
||||
}
|
||||
StringTable stringTable(f); // read the string table
|
||||
if(f.tellg() != fileSize)
|
||||
stop("computeExternalSymbols: Unexpected data after string table");
|
||||
|
||||
f.clear();
|
||||
f.seekg(symTabStart); // seek to the symbol table
|
||||
|
||||
defined->clear(); undefined->clear();
|
||||
for(int i = 0; i < symNEntries; ++i) {
|
||||
// process each entry
|
||||
Symbol e;
|
||||
|
||||
if(f.eof())
|
||||
stop("computeExternalSymbols: Unexpected EOF 2");
|
||||
f>>e;
|
||||
if(f.fail())
|
||||
stop("computeExternalSymbols: File read error");
|
||||
if(e.nAux) { // auxiliary entry: skip
|
||||
f.seekg(e.nAux * 18, ios::cur);
|
||||
i += e.nAux;
|
||||
}
|
||||
// if symbol is extern and defined in the current file, insert it
|
||||
if(e.storageClass == 2)
|
||||
if(e.sectionNum)
|
||||
defined->insert(stringTable.decode(e.name));
|
||||
else
|
||||
undefined->insert(stringTable.decode(e.name));
|
||||
f.seekg(8);
|
||||
f >> symTabStart >> symNEntries;
|
||||
// seek to the string table
|
||||
f.seekg(strTabStart = symTabStart + 18 * (size_t)symNEntries);
|
||||
if (f.eof()) {
|
||||
printf("computeExternalSymbols: fileName='%s', fileSize = %lu, symTabStart "
|
||||
"= %u, symNEntries = %u\n",
|
||||
fileName, (unsigned long)fileSize, symTabStart, symNEntries);
|
||||
stop("computeExternalSymbols: Unexpected EOF 1");
|
||||
}
|
||||
StringTable stringTable(f); // read the string table
|
||||
if (f.tellg() != fileSize)
|
||||
stop("computeExternalSymbols: Unexpected data after string table");
|
||||
|
||||
f.clear();
|
||||
f.seekg(symTabStart); // seek to the symbol table
|
||||
|
||||
defined->clear();
|
||||
undefined->clear();
|
||||
for (int i = 0; i < symNEntries; ++i) {
|
||||
// process each entry
|
||||
Symbol e;
|
||||
|
||||
if (f.eof())
|
||||
stop("computeExternalSymbols: Unexpected EOF 2");
|
||||
f >> e;
|
||||
if (f.fail())
|
||||
stop("computeExternalSymbols: File read error");
|
||||
if (e.nAux) { // auxiliary entry: skip
|
||||
f.seekg(e.nAux * 18, ios::cur);
|
||||
i += e.nAux;
|
||||
}
|
||||
// if symbol is extern and defined in the current file, insert it
|
||||
if (e.storageClass == 2)
|
||||
if (e.sectionNum)
|
||||
defined->insert(stringTable.decode(e.name));
|
||||
else
|
||||
undefined->insert(stringTable.decode(e.name));
|
||||
}
|
||||
}
|
||||
|
||||
/* For each occurrence of an external symbol in the object file named by
|
||||
by <fileName> that is a member of <hide>, renames it by prefixing
|
||||
with "__kmp_external_", writing back the file in-place
|
||||
*/
|
||||
// For each occurrence of an external symbol in the object file named by
|
||||
// by <fileName> that is a member of <hide>, renames it by prefixing
|
||||
// with "__kmp_external_", writing back the file in-place
|
||||
void hideSymbols(char *fileName, const set<string> &hide) {
|
||||
static const string prefix("__kmp_external_");
|
||||
set<string> strings; // set of all occurring symbols, appropriately prefixed
|
||||
streampos fileSize;
|
||||
size_t strTabStart;
|
||||
unsigned symTabStart, symNEntries;
|
||||
int i;
|
||||
rstream in(fileName);
|
||||
static const string prefix("__kmp_external_");
|
||||
set<string> strings; // set of all occurring symbols, appropriately prefixed
|
||||
streampos fileSize;
|
||||
size_t strTabStart;
|
||||
unsigned symTabStart, symNEntries;
|
||||
int i;
|
||||
rstream in(fileName);
|
||||
|
||||
in.seekg(0,ios::end);
|
||||
fileSize = in.tellg();
|
||||
in.seekg(0, ios::end);
|
||||
fileSize = in.tellg();
|
||||
|
||||
in.seekg(8);
|
||||
in >> symTabStart >> symNEntries;
|
||||
in.seekg(strTabStart = symTabStart + 18 * (size_t)symNEntries);
|
||||
if(in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
StringTable stringTableOld(in); // read original string table
|
||||
in.seekg(8);
|
||||
in >> symTabStart >> symNEntries;
|
||||
in.seekg(strTabStart = symTabStart + 18 * (size_t)symNEntries);
|
||||
if (in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
StringTable stringTableOld(in); // read original string table
|
||||
|
||||
if(in.tellg() != fileSize)
|
||||
stop("hideSymbols: Unexpected data after string table");
|
||||
if (in.tellg() != fileSize)
|
||||
stop("hideSymbols: Unexpected data after string table");
|
||||
|
||||
// compute set of occurring strings with prefix added
|
||||
for(i = 0; i < symNEntries; ++i) {
|
||||
Symbol e;
|
||||
// compute set of occurring strings with prefix added
|
||||
for (i = 0; i < symNEntries; ++i) {
|
||||
Symbol e;
|
||||
|
||||
in.seekg(symTabStart + i * 18);
|
||||
if(in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
in >> e;
|
||||
if(in.fail())
|
||||
stop("hideSymbols: File read error");
|
||||
if(e.nAux)
|
||||
i += e.nAux;
|
||||
const string &s = stringTableOld.decode(e.name);
|
||||
// if symbol is extern and found in <hide>, prefix and insert into strings,
|
||||
// otherwise, just insert into strings without prefix
|
||||
strings.insert( (e.storageClass == 2 && hide.find(s) != hide.end()) ?
|
||||
prefix + s : s);
|
||||
in.seekg(symTabStart + i * 18);
|
||||
if (in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
in >> e;
|
||||
if (in.fail())
|
||||
stop("hideSymbols: File read error");
|
||||
if (e.nAux)
|
||||
i += e.nAux;
|
||||
const string &s = stringTableOld.decode(e.name);
|
||||
// if symbol is extern and found in <hide>, prefix and insert into strings,
|
||||
// otherwise, just insert into strings without prefix
|
||||
strings.insert(
|
||||
(e.storageClass == 2 && hide.find(s) != hide.end()) ? prefix + s : s);
|
||||
}
|
||||
|
||||
ofstream out(fileName, ios::trunc | ios::out | ios::binary);
|
||||
if (!out.is_open())
|
||||
stop("hideSymbols: Error opening output file");
|
||||
|
||||
// make new string table from string set
|
||||
StringTable stringTableNew = StringTable(strings);
|
||||
|
||||
// copy input file to output file up to just before the symbol table
|
||||
in.seekg(0);
|
||||
char *buf = new char[symTabStart];
|
||||
in.read(buf, symTabStart);
|
||||
out.write(buf, symTabStart);
|
||||
delete[] buf;
|
||||
|
||||
// copy input symbol table to output symbol table with name translation
|
||||
for (i = 0; i < symNEntries; ++i) {
|
||||
Symbol e;
|
||||
|
||||
in.seekg(symTabStart + i * 18);
|
||||
if (in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
in >> e;
|
||||
if (in.fail())
|
||||
stop("hideSymbols: File read error");
|
||||
const string &s = stringTableOld.decode(e.name);
|
||||
out.seekp(symTabStart + i * 18);
|
||||
e.name = stringTableNew.encode(
|
||||
(e.storageClass == 2 && hide.find(s) != hide.end()) ? prefix + s : s);
|
||||
out.write((char *)&e, 18);
|
||||
if (out.fail())
|
||||
stop("hideSymbols: File write error");
|
||||
if (e.nAux) {
|
||||
// copy auxiliary symbol table entries
|
||||
int nAux = e.nAux;
|
||||
for (int j = 1; j <= nAux; ++j) {
|
||||
in >> e;
|
||||
out.seekp(symTabStart + (i + j) * 18);
|
||||
out.write((char *)&e, 18);
|
||||
}
|
||||
i += nAux;
|
||||
}
|
||||
|
||||
ofstream out(fileName, ios::trunc | ios::out | ios::binary);
|
||||
if(!out.is_open())
|
||||
stop("hideSymbols: Error opening output file");
|
||||
|
||||
// make new string table from string set
|
||||
StringTable stringTableNew = StringTable(strings);
|
||||
|
||||
// copy input file to output file up to just before the symbol table
|
||||
in.seekg(0);
|
||||
char *buf = new char[symTabStart];
|
||||
in.read(buf, symTabStart);
|
||||
out.write(buf, symTabStart);
|
||||
delete []buf;
|
||||
|
||||
// copy input symbol table to output symbol table with name translation
|
||||
for(i = 0; i < symNEntries; ++i) {
|
||||
Symbol e;
|
||||
|
||||
in.seekg(symTabStart + i*18);
|
||||
if(in.eof())
|
||||
stop("hideSymbols: Unexpected EOF");
|
||||
in >> e;
|
||||
if(in.fail())
|
||||
stop("hideSymbols: File read error");
|
||||
const string &s = stringTableOld.decode(e.name);
|
||||
out.seekp(symTabStart + i*18);
|
||||
e.name = stringTableNew.encode( (e.storageClass == 2 && hide.find(s) != hide.end()) ?
|
||||
prefix + s : s);
|
||||
out.write((char*)&e, 18);
|
||||
if(out.fail())
|
||||
stop("hideSymbols: File write error");
|
||||
if(e.nAux) {
|
||||
// copy auxiliary symbol table entries
|
||||
int nAux = e.nAux;
|
||||
for(int j = 1; j <= nAux; ++j) {
|
||||
in >> e;
|
||||
out.seekp(symTabStart + (i + j) * 18);
|
||||
out.write((char*)&e, 18);
|
||||
}
|
||||
i += nAux;
|
||||
}
|
||||
}
|
||||
// output string table
|
||||
stringTableNew.write(out);
|
||||
}
|
||||
// output string table
|
||||
stringTableNew.write(out);
|
||||
}
|
||||
|
||||
// returns true iff <a> and <b> have no common element
|
||||
template <class T>
|
||||
bool isDisjoint(const set<T> &a, const set<T> &b) {
|
||||
set<T>::const_iterator ita, itb;
|
||||
template <class T> bool isDisjoint(const set<T> &a, const set<T> &b) {
|
||||
set<T>::const_iterator ita, itb;
|
||||
|
||||
for(ita = a.begin(), itb = b.begin(); ita != a.end() && itb != b.end();) {
|
||||
const T &ta = *ita, &tb = *itb;
|
||||
if(ta < tb)
|
||||
++ita;
|
||||
else if (tb < ta)
|
||||
++itb;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
for (ita = a.begin(), itb = b.begin(); ita != a.end() && itb != b.end();) {
|
||||
const T &ta = *ita, &tb = *itb;
|
||||
if (ta < tb)
|
||||
++ita;
|
||||
else if (tb < ta)
|
||||
++itb;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* precondition: <defined> and <undefined> are arrays with <nTotal> elements where
|
||||
<nTotal> >= <nExternal>. The first <nExternal> elements correspond to the external object
|
||||
files and the rest correspond to the internal object files.
|
||||
postcondition: file x is said to depend on file y if undefined[x] and defined[y] are not
|
||||
disjoint. Returns the transitive closure of the set of internal object files, as a set of
|
||||
file indexes, under the 'depends on' relation, minus the set of internal object files.
|
||||
*/
|
||||
set<int> *findRequiredExternal(int nExternal, int nTotal, set<string> *defined, set<string> *undefined) {
|
||||
set<int> *required = new set<int>;
|
||||
set<int> fresh[2];
|
||||
int i, cur = 0;
|
||||
bool changed;
|
||||
// PRE: <defined> and <undefined> are arrays with <nTotal> elements where
|
||||
// <nTotal> >= <nExternal>. The first <nExternal> elements correspond to the
|
||||
// external object files and the rest correspond to the internal object files.
|
||||
// POST: file x is said to depend on file y if undefined[x] and defined[y] are
|
||||
// not disjoint. Returns the transitive closure of the set of internal object
|
||||
// files, as a set of file indexes, under the 'depends on' relation, minus the
|
||||
// set of internal object files.
|
||||
set<int> *findRequiredExternal(int nExternal, int nTotal, set<string> *defined,
|
||||
set<string> *undefined) {
|
||||
set<int> *required = new set<int>;
|
||||
set<int> fresh[2];
|
||||
int i, cur = 0;
|
||||
bool changed;
|
||||
|
||||
for(i = nTotal - 1; i >= nExternal; --i)
|
||||
fresh[cur].insert(i);
|
||||
do {
|
||||
changed = false;
|
||||
for(set<int>::iterator it = fresh[cur].begin(); it != fresh[cur].end(); ++it) {
|
||||
set<string> &s = undefined[*it];
|
||||
for (i = nTotal - 1; i >= nExternal; --i)
|
||||
fresh[cur].insert(i);
|
||||
do {
|
||||
changed = false;
|
||||
for (set<int>::iterator it = fresh[cur].begin(); it != fresh[cur].end();
|
||||
++it) {
|
||||
set<string> &s = undefined[*it];
|
||||
|
||||
for(i = 0; i < nExternal; ++i) {
|
||||
if(required->find(i) == required->end()) {
|
||||
if(!isDisjoint(defined[i], s)) {
|
||||
// found a new qualifying element
|
||||
required->insert(i);
|
||||
fresh[1 - cur].insert(i);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fresh[cur].clear();
|
||||
cur = 1 - cur;
|
||||
} while(changed);
|
||||
return required;
|
||||
for (i = 0; i < nExternal; ++i) {
|
||||
if (required->find(i) == required->end()) {
|
||||
if (!isDisjoint(defined[i], s)) {
|
||||
// found a new qualifying element
|
||||
required->insert(i);
|
||||
fresh[1 - cur].insert(i);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fresh[cur].clear();
|
||||
cur = 1 - cur;
|
||||
} while (changed);
|
||||
return required;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int nExternal, nInternal, i;
|
||||
set<string> *defined, *undefined;
|
||||
set<int>::iterator it;
|
||||
int nExternal, nInternal, i;
|
||||
set<string> *defined, *undefined;
|
||||
set<int>::iterator it;
|
||||
|
||||
if(argc < 3)
|
||||
stop("Please specify a positive integer followed by a list of object filenames");
|
||||
nExternal = atoi(argv[1]);
|
||||
if(nExternal <= 0)
|
||||
stop("Please specify a positive integer followed by a list of object filenames");
|
||||
if(nExternal + 2 > argc)
|
||||
stop("Too few external objects");
|
||||
nInternal = argc - nExternal - 2;
|
||||
defined = new set<string>[argc - 2];
|
||||
undefined = new set<string>[argc - 2];
|
||||
if (argc < 3)
|
||||
stop("Please specify a positive integer followed by a list of object "
|
||||
"filenames");
|
||||
nExternal = atoi(argv[1]);
|
||||
if (nExternal <= 0)
|
||||
stop("Please specify a positive integer followed by a list of object "
|
||||
"filenames");
|
||||
if (nExternal + 2 > argc)
|
||||
stop("Too few external objects");
|
||||
nInternal = argc - nExternal - 2;
|
||||
defined = new set<string>[argc - 2];
|
||||
undefined = new set<string>[argc - 2];
|
||||
|
||||
// determine the set of defined and undefined external symbols
|
||||
for(i = 2; i < argc; ++i)
|
||||
computeExternalSymbols(argv[i], defined + i - 2, undefined + i - 2);
|
||||
// determine the set of defined and undefined external symbols
|
||||
for (i = 2; i < argc; ++i)
|
||||
computeExternalSymbols(argv[i], defined + i - 2, undefined + i - 2);
|
||||
|
||||
// determine the set of required external files
|
||||
set<int> *requiredExternal = findRequiredExternal(nExternal, argc - 2, defined, undefined);
|
||||
set<string> hide;
|
||||
// determine the set of required external files
|
||||
set<int> *requiredExternal =
|
||||
findRequiredExternal(nExternal, argc - 2, defined, undefined);
|
||||
set<string> hide;
|
||||
|
||||
/* determine the set of symbols to hide--namely defined external symbols of the
|
||||
required external files
|
||||
*/
|
||||
for(it = requiredExternal->begin(); it != requiredExternal->end(); ++it) {
|
||||
int idx = *it;
|
||||
set<string>::iterator it2;
|
||||
/* We have to insert one element at a time instead of inserting a range because
|
||||
the insert member function taking a range doesn't exist on Windows* OS, at least
|
||||
at the time of this writing.
|
||||
*/
|
||||
for(it2 = defined[idx].begin(); it2 != defined[idx].end(); ++it2)
|
||||
hide.insert(*it2);
|
||||
}
|
||||
// determine the set of symbols to hide--namely defined external symbols of
|
||||
// the required external files
|
||||
for (it = requiredExternal->begin(); it != requiredExternal->end(); ++it) {
|
||||
int idx = *it;
|
||||
set<string>::iterator it2;
|
||||
// We have to insert one element at a time instead of inserting a range
|
||||
// because the insert member function taking a range doesn't exist on
|
||||
// Windows* OS, at least at the time of this writing.
|
||||
for (it2 = defined[idx].begin(); it2 != defined[idx].end(); ++it2)
|
||||
hide.insert(*it2);
|
||||
}
|
||||
|
||||
/* process the external files--removing those that are not required and hiding
|
||||
the appropriate symbols in the others
|
||||
*/
|
||||
for(i = 0; i < nExternal; ++i)
|
||||
if(requiredExternal->find(i) != requiredExternal->end())
|
||||
hideSymbols(argv[2 + i], hide);
|
||||
else
|
||||
remove(argv[2 + i]);
|
||||
// hide the appropriate symbols in the internal files
|
||||
for(i = nExternal + 2; i < argc; ++i)
|
||||
hideSymbols(argv[i], hide);
|
||||
return 0;
|
||||
// process the external files--removing those that are not required and hiding
|
||||
// the appropriate symbols in the others
|
||||
for (i = 0; i < nExternal; ++i)
|
||||
if (requiredExternal->find(i) != requiredExternal->end())
|
||||
hideSymbols(argv[2 + i], hide);
|
||||
else
|
||||
remove(argv[2 + i]);
|
||||
// hide the appropriate symbols in the internal files
|
||||
for (i = nExternal + 2; i < argc; ++i)
|
||||
hideSymbols(argv[i], hide);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+43
-25
@@ -1,6 +1,4 @@
|
||||
# en_US.txt #
|
||||
# $Revision: 42659 $
|
||||
# $Date: 2013-09-12 09:22:48 -0500 (Thu, 12 Sep 2013) $
|
||||
|
||||
#
|
||||
#//===----------------------------------------------------------------------===//
|
||||
@@ -40,7 +38,7 @@ Language "English"
|
||||
Country "USA"
|
||||
LangId "1033"
|
||||
Version "2"
|
||||
Revision "20130911"
|
||||
Revision "20161216"
|
||||
|
||||
|
||||
|
||||
@@ -137,7 +135,6 @@ Pragma "%1$s pragma (at %2$s:%3$s():%4$s)"
|
||||
# Aff -- Affinity messages.
|
||||
# Cns -- Consistency check failures (KMP_CONSISTENCY_CHECK).
|
||||
# Itt -- ITT Notify-related messages.
|
||||
# Rml -- RML-related messages.
|
||||
|
||||
LibraryIsSerial "Library is \"serial\"."
|
||||
CantOpenMessageCatalog "Cannot open message catalog \"%1$s\":"
|
||||
@@ -290,7 +287,7 @@ ChangeThreadAffMaskError "Cannot change thread affinity mask."
|
||||
ThreadsMigrate "%1$s: Threads may migrate across %2$d innermost levels of machine"
|
||||
DecreaseToThreads "%1$s: decrease to %2$d threads"
|
||||
IncreaseToThreads "%1$s: increase to %2$d threads"
|
||||
BoundToOSProcSet "%1$s: Internal thread %2$d bound to OS proc set %3$s"
|
||||
OBSOLETE "%1$s: Internal thread %2$d bound to OS proc set %3$s"
|
||||
AffCapableUseCpuinfo "%1$s: Affinity capable, using cpuinfo file"
|
||||
AffUseGlobCpuid "%1$s: Affinity capable, using global cpuid info"
|
||||
AffCapableUseFlat "%1$s: Affinity capable, using default \"flat\" topology"
|
||||
@@ -315,7 +312,7 @@ OBSOLETE "%1$s: OS proc %2$d maps to package %3$d core %4$d
|
||||
OBSOLETE "%1$s: OS proc %2$d maps to package %3$d [core %4$d] thread %5$d"
|
||||
OBSOLETE "%1$s: OS proc %2$d maps to package %3$d core %4$d thread %5$d"
|
||||
OSProcMapToPack "%1$s: OS proc %2$d maps to %3$s"
|
||||
ChangeAffMask "%1$s: Internal thread %2$d changed affinity mask from %3$s to %4$s"
|
||||
OBSOLETE "%1$s: Internal thread %2$d changed affinity mask from %3$s to %4$s"
|
||||
OBSOLETE "%1$s: OS proc %2$d maps to package %3$d, CPU %4$d, TPU %5$d"
|
||||
OBSOLETE "%1$s: OS proc %2$d maps to package %3$d, CPU %4$d"
|
||||
OBSOLETE "%1$s: HT enabled; %2$d packages; %3$d TPU; %4$d TPUs per package"
|
||||
@@ -324,8 +321,8 @@ BarriersInDifferentOrder "Threads encountered barriers in different order. "
|
||||
FunctionError "Function %1$s failed:"
|
||||
TopologyExtra "%1$s: %2$s packages x %3$d cores/pkg x %4$d threads/core (%5$d total cores)"
|
||||
WrongMessageCatalog "Incompatible message catalog \"%1$s\": Version \"%2$s\" found, version \"%3$s\" expected."
|
||||
StgIgnored "%1$s: ignored because %3$s has been defined"
|
||||
# %1, %2 -- name and value of ignored variable, %3 -- name of variable with higher priority.
|
||||
StgIgnored "%1$s: ignored because %2$s has been defined"
|
||||
# %1, -- name of ignored variable, %2 -- name of variable with higher priority.
|
||||
OBSOLETE "%1$s: overrides %3$s specified before"
|
||||
# %1, %2 -- name and value of the overriding variable, %3 -- name of overriden variable.
|
||||
|
||||
@@ -354,7 +351,7 @@ CantConnectUsing "Cannot connect to %1$s - Using %2$s"
|
||||
LibNotSupport "%1$s does not support %2$s. Continuing without using %2$s."
|
||||
LibNotSupportFor "%1$s does not support %2$s for %3$s. Continuing without using %2$s."
|
||||
StaticLibNotSupport "Static %1$s does not support %2$s. Continuing without using %2$s."
|
||||
DynIRMLwoUseIrml "KMP_DYNAMIC_MODE=irml cannot be used with KMP_USE_IRML=0"
|
||||
OBSOLETE "KMP_DYNAMIC_MODE=irml cannot be used with KMP_USE_IRML=0"
|
||||
IttUnknownGroup "ittnotify: Unknown group \"%2$s\" specified in environment variable \"%1$s\"."
|
||||
IttEnvVarTooLong "ittnotify: Environment variable \"%1$s\" too long: Actual lengths is %2$lu, max allowed length is %3$lu."
|
||||
AffUseGlobCpuidL11 "%1$s: Affinity capable, using global cpuid leaf 11 info"
|
||||
@@ -369,15 +366,15 @@ IncompatibleLibrary "Incompatible %1$s library with version %2$s found.
|
||||
IttFunctionError "ittnotify: Function %1$s failed:"
|
||||
IttUnknownError "ittnofify: Error #%1$d."
|
||||
EnvMiddleWarn "%1$s must be set prior to first parallel region or certain API calls; ignored."
|
||||
CnsLockNotDestroyed "Lock initialized at %1$s(%3$d) was not destroyed"
|
||||
# %1, %2, %3, %4 -- file, func, line, col
|
||||
CnsLockNotDestroyed "Lock initialized at %1$s(%2$d) was not destroyed"
|
||||
# %1, %2, %3, %4 -- file, line, func, col
|
||||
CantLoadBalUsing "Cannot determine machine load balance - Using %1$s"
|
||||
AffNotCapableUsePthread "%1$s: Affinity not capable, using pthread info"
|
||||
AffUsePthread "%1$s: Affinity capable, using pthread info"
|
||||
RmlLoadLibFailed "Loading \"%1$s\" library failed:"
|
||||
RmlLookupFailed "Lookup of \"%1$s\" function failed:"
|
||||
RmlBufferTooSmall "Buffer too small."
|
||||
RmlUnknownError "Error #%1$d."
|
||||
OBSOLETE "Loading \"%1$s\" library failed:"
|
||||
OBSOLETE "Lookup of \"%1$s\" function failed:"
|
||||
OBSOLETE "Buffer too small."
|
||||
OBSOLETE "Error #%1$d."
|
||||
NthSyntaxError "%1$s: Invalid symbols found. Check the value \"%2$s\"."
|
||||
NthSpacesNotAllowed "%1$s: Spaces between digits are not allowed \"%2$s\"."
|
||||
AffStrParseFilename "%1$s: %2$s - parsing %3$s."
|
||||
@@ -391,13 +388,34 @@ OBSOLETE "%1$s: granularity=core will be used."
|
||||
EnvLockWarn "%1$s must be set prior to first OMP lock call or critical section; ignored."
|
||||
FutexNotSupported "futex system call not supported; %1$s=%2$s ignored."
|
||||
AffGranUsing "%1$s: granularity=%2$s will be used."
|
||||
AffThrPlaceInvalid "%1$s: invalid value \"%2$s\", valid format is \"nC,mT[,kO]\"."
|
||||
AffThrPlaceUnsupported "KMP_PLACE_THREADS ignored: unsupported architecture."
|
||||
AffThrPlaceManyCores "KMP_PLACE_THREADS ignored: too many cores requested."
|
||||
AffHWSubsetInvalid "%1$s: invalid value \"%2$s\", valid format is \"N<item>[@N][,...][,Nt] "
|
||||
"(<item> can be S, N, L2, C, T for Socket, NUMA Node, L2 Cache, Core, Thread)\"."
|
||||
AffHWSubsetUnsupported "KMP_HW_SUBSET ignored: unsupported architecture."
|
||||
AffHWSubsetManyCores "KMP_HW_SUBSET ignored: too many cores requested."
|
||||
SyntaxErrorUsing "%1$s: syntax error, using %2$s."
|
||||
AdaptiveNotSupported "%1$s: Adaptive locks are not supported; using queuing."
|
||||
EnvSyntaxError "%1$s: Invalid symbols found. Check the value \"%2$s\"."
|
||||
EnvSpacesNotAllowed "%1$s: Spaces between digits are not allowed \"%2$s\"."
|
||||
AdaptiveNotSupported "%1$s: Adaptive locks are not supported; using queuing."
|
||||
EnvSyntaxError "%1$s: Invalid symbols found. Check the value \"%2$s\"."
|
||||
EnvSpacesNotAllowed "%1$s: Spaces between digits are not allowed \"%2$s\"."
|
||||
BoundToOSProcSet "%1$s: pid %2$d tid %3$d thread %4$d bound to OS proc set %5$s"
|
||||
CnsLoopIncrIllegal "%1$s error: parallel loop increment and condition are inconsistent."
|
||||
NoGompCancellation "libgomp cancellation is not currently supported."
|
||||
AffHWSubsetNonUniform "KMP_HW_SUBSET ignored: non-uniform topology."
|
||||
AffHWSubsetNonThreeLevel "KMP_HW_SUBSET ignored: only three-level topology is supported."
|
||||
AffGranTopGroup "%1$s: granularity=%2$s is not supported with KMP_TOPOLOGY_METHOD=group. Using \"granularity=fine\"."
|
||||
AffGranGroupType "%1$s: granularity=group is not supported with KMP_AFFINITY=%2$s. Using \"granularity=core\"."
|
||||
AffHWSubsetManySockets "KMP_HW_SUBSET ignored: too many sockets requested."
|
||||
AffHWSubsetDeprecated "KMP_HW_SUBSET \"o\" offset designator deprecated, please use @ prefix for offset value."
|
||||
AffUsingHwloc "%1$s: Affinity capable, using hwloc."
|
||||
AffIgnoringHwloc "%1$s: Ignoring hwloc mechanism."
|
||||
AffHwlocErrorOccurred "%1$s: Hwloc failed in %2$s. Relying on internal affinity mechanisms."
|
||||
EnvSerialWarn "%1$s must be set prior to OpenMP runtime library initialization; ignored."
|
||||
EnvVarDeprecated "%1$s variable deprecated, please use %2$s instead."
|
||||
RedMethodNotSupported "KMP_FORCE_REDUCTION: %1$s method is not supported; using critical."
|
||||
AffHWSubsetNoHWLOC "KMP_HW_SUBSET ignored: unsupported item requested for non-HWLOC topology method (KMP_TOPOLOGY_METHOD)"
|
||||
AffHWSubsetManyNodes "KMP_HW_SUBSET ignored: too many NUMA Nodes requested."
|
||||
AffHWSubsetManyTiles "KMP_HW_SUBSET ignored: too many L2 Caches requested."
|
||||
AffHWSubsetManyProcs "KMP_HW_SUBSET ignored: too many Procs requested."
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
-*- HINTS -*-
|
||||
@@ -411,7 +429,7 @@ SubmitBugReport "Please submit a bug report with this message, comp
|
||||
"compiler and operating system versions. Faster response will be "
|
||||
"obtained by including all program sources. For information on "
|
||||
"submitting this issue, please see "
|
||||
"http://www.intel.com/software/products/support/."
|
||||
"https://bugs.llvm.org/."
|
||||
OBSOLETE "Check NLSPATH environment variable, its value is \"%1$s\"."
|
||||
ChangeStackLimit "Please try changing the shell stack limit or adjusting the "
|
||||
"OMP_STACKSIZE environment variable."
|
||||
@@ -427,7 +445,7 @@ DuplicateLibrary "This means that multiple copies of the OpenMP runt
|
||||
"you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow "
|
||||
"the program to continue to execute, but that may cause crashes or "
|
||||
"silently produce incorrect results. "
|
||||
"For more information, please see http://www.intel.com/software/products/support/."
|
||||
"For more information, please see http://openmp.llvm.org/"
|
||||
NameComesFrom_CPUINFO_FILE "This name is specified in environment variable KMP_CPUINFO_FILE."
|
||||
NotEnoughMemory "Seems application required too much memory."
|
||||
ValidBoolValues "Use \"0\", \"FALSE\". \".F.\", \"off\", \"no\" as false values, "
|
||||
@@ -448,8 +466,8 @@ GetNewerLibrary "It could be a result of using an older OMP library
|
||||
"compiler or memory corruption. You may check the proper OMP library "
|
||||
"is linked to the application."
|
||||
CheckEnvVar "Check %1$s environment variable, its value is \"%2$s\"."
|
||||
GetNewerIOMPLibrary "You may want to use an %1$s library that supports %2$s interface with version %3$s."
|
||||
GetNewerIRMLLibrary "You may want to use an %1$s library with version %2$s."
|
||||
OBSOLETE "You may want to use an %1$s library that supports %2$s interface with version %3$s."
|
||||
OBSOLETE "You may want to use an %1$s library with version %2$s."
|
||||
BadExeFormat "System error #193 is \"Bad format of EXE or DLL file\". "
|
||||
"Usually it means the file is found, but it is corrupted or "
|
||||
"a file for another architecture. "
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* include/25/iomp.h.var
|
||||
* $Revision: 42061 $
|
||||
* $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __IOMP_H
|
||||
# define __IOMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define kmp_set_stacksize kmpc_set_stacksize
|
||||
# define kmp_set_stacksize_s kmpc_set_stacksize_s
|
||||
# define kmp_set_blocktime kmpc_set_blocktime
|
||||
# define kmp_set_library kmpc_set_library
|
||||
# define kmp_set_defaults kmpc_set_defaults
|
||||
|
||||
# define kmp_malloc kmpc_malloc
|
||||
# define kmp_calloc kmpc_calloc
|
||||
# define kmp_realloc kmpc_realloc
|
||||
# define kmp_free kmpc_free
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __IOMP_H */
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
! include/25/iomp_lib.h.var
|
||||
! $Revision: 42061 $
|
||||
! $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** omp_integer_kind and omp_logical_kind appear to be predefined by gcc and
|
||||
!*** gfortran (definitions do not appear in the omp.h / omp_lib.h /omp_lib.f).
|
||||
!*** omp_real_kind is not predefined, however.
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
|
||||
!***
|
||||
!*** kmp_* type extensions
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_pointer_kind = $KMP_INT_PTR_KIND
|
||||
integer, parameter :: kmp_size_t_kind = $KMP_INT_PTR_KIND
|
||||
|
||||
!***
|
||||
!*** kmp_* entry points
|
||||
!***
|
||||
|
||||
external kmp_set_stacksize
|
||||
external kmp_set_stacksize_s
|
||||
external kmp_set_blocktime
|
||||
external kmp_set_library_serial
|
||||
external kmp_set_library_turnaround
|
||||
external kmp_set_library_throughput
|
||||
external kmp_set_library
|
||||
external kmp_set_defaults
|
||||
external kmp_get_stacksize
|
||||
integer kmp_get_stacksize
|
||||
external kmp_get_stacksize_s
|
||||
integer (kind = kmp_size_t_kind) kmp_get_stacksize_s
|
||||
external kmp_get_blocktime
|
||||
integer kmp_get_blocktime
|
||||
external kmp_get_library
|
||||
integer kmp_get_library
|
||||
external kmp_malloc
|
||||
integer (kind = kmp_pointer_kind) kmp_malloc
|
||||
external kmp_calloc
|
||||
integer (kind = kmp_pointer_kind) kmp_calloc
|
||||
external kmp_realloc
|
||||
integer (kind = kmp_pointer_kind) kmp_realloc
|
||||
external kmp_free
|
||||
external kmp_set_warnings_on
|
||||
external kmp_set_warnings_off
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* include/25/omp.h.var
|
||||
* $Revision: 42061 $
|
||||
* $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define omp_set_num_threads ompc_set_num_threads
|
||||
# define omp_set_dynamic ompc_set_dynamic
|
||||
# define omp_set_nested ompc_set_nested
|
||||
|
||||
# define kmp_set_stacksize kmpc_set_stacksize
|
||||
# define kmp_set_stacksize_s kmpc_set_stacksize_s
|
||||
# define kmp_set_blocktime kmpc_set_blocktime
|
||||
# define kmp_set_library kmpc_set_library
|
||||
# define kmp_set_defaults kmpc_set_defaults
|
||||
|
||||
# define kmp_malloc kmpc_malloc
|
||||
# define kmp_calloc kmpc_calloc
|
||||
# define kmp_realloc kmpc_realloc
|
||||
# define kmp_free kmpc_free
|
||||
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
/* set API functions */
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
|
||||
|
||||
/* query API functions */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
|
||||
|
||||
/* lock API functions */
|
||||
typedef struct omp_lock_t {
|
||||
void * _lk;
|
||||
} omp_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
|
||||
|
||||
/* nested lock API functions */
|
||||
typedef struct omp_nest_lock_t {
|
||||
void * _lk;
|
||||
} omp_nest_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
|
||||
|
||||
/* time API functions */
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
|
||||
|
||||
# include <stdlib.h>
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __OMP_H */
|
||||
|
||||
@@ -1,472 +0,0 @@
|
||||
! include/25/omp_lib.f.var
|
||||
! $Revision: 42181 $
|
||||
! $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!dec$ fixedformlinesize:132
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
integer, parameter :: omp_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_pointer_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE'
|
||||
integer, parameter :: openmp_version = 200505
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) nthreads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) enable
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) enable
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_get_dynamic()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_wtime()
|
||||
use omp_lib_kinds
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick ()
|
||||
use omp_lib_kinds
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
subroutine omp_init_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial()
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround()
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput()
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string)
|
||||
character*(*) string
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s()
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
function kmp_malloc(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind) nelem
|
||||
integer (kind=kmp_size_t_kind) elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on()
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off()
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
end interface
|
||||
|
||||
!dec$ if defined(_WIN32)
|
||||
!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
|
||||
|
||||
!***
|
||||
!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
|
||||
!*** option is specified. The alias attribute ensures that the specified
|
||||
!*** string is used as the entry point.
|
||||
!***
|
||||
!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended. On the Windows* OS Intel(R) 64
|
||||
!*** architecture, no underscore is prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ else
|
||||
|
||||
!***
|
||||
!*** On Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__linux)
|
||||
|
||||
!***
|
||||
!*** The Linux* OS entry points are in lowercase, with an underscore appended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__APPLE__)
|
||||
|
||||
!***
|
||||
!*** The Mac entry points are in lowercase, with an both an underscore
|
||||
!*** appended and an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
|
||||
end module omp_lib
|
||||
|
||||
|
||||
@@ -1,256 +0,0 @@
|
||||
! include/25/omp_lib.f90.var
|
||||
! $Revision: 42061 $
|
||||
! $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
|
||||
integer, parameter :: omp_integer_kind = c_int
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = c_float
|
||||
integer, parameter :: kmp_double_kind = c_double
|
||||
integer, parameter :: omp_lock_kind = c_intptr_t
|
||||
integer, parameter :: omp_nest_lock_kind = c_intptr_t
|
||||
integer, parameter :: kmp_pointer_kind = c_intptr_t
|
||||
integer, parameter :: kmp_size_t_kind = c_size_t
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer, parameter :: openmp_version = 200505
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: nthreads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_wtime() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
subroutine omp_init_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial() bind(c)
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround() bind(c)
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput() bind(c)
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string) bind(c)
|
||||
use, intrinsic :: iso_c_binding
|
||||
character (kind=c_char) :: string(*)
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
function kmp_malloc(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind), value :: nelem
|
||||
integer (kind=kmp_size_t_kind), value :: elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on() bind(c)
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off() bind(c)
|
||||
use omp_lib_kinds
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
end interface
|
||||
|
||||
end module omp_lib
|
||||
@@ -1,460 +0,0 @@
|
||||
! include/25/omp_lib.h.var
|
||||
! $Revision: 42181 $
|
||||
! $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!dec$ fixedformlinesize:132
|
||||
|
||||
include 'omp_lib_kinds.h'
|
||||
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE'
|
||||
integer, parameter :: openmp_version = 200505
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) nthreads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable)
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) enable
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable)
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) enable
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel()
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_get_dynamic()
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested()
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_wtime()
|
||||
include 'omp_lib_kinds.h'
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick ()
|
||||
include 'omp_lib_kinds.h'
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
subroutine omp_init_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial()
|
||||
include 'omp_lib_kinds.h'
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround()
|
||||
include 'omp_lib_kinds.h'
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput()
|
||||
include 'omp_lib_kinds.h'
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string)
|
||||
character*(*) string
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library()
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
function kmp_malloc(size)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind) nelem
|
||||
integer (kind=kmp_size_t_kind) elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr)
|
||||
include 'omp_lib_kinds.h'
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on()
|
||||
include 'omp_lib_kinds.h'
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off()
|
||||
include 'omp_lib_kinds.h'
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
end interface
|
||||
|
||||
!dec$ if defined(_WIN32)
|
||||
!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
|
||||
|
||||
!***
|
||||
!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
|
||||
!*** option is specified. The alias attribute ensures that the specified
|
||||
!*** string is used as the entry point.
|
||||
!***
|
||||
!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended. On the Windows* OS Intel(R) 64
|
||||
!*** architecture, no underscore is prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'OMP_SET_NUM_THREADS'::omp_set_num_threads
|
||||
!dec$ attributes alias:'OMP_SET_DYNAMIC'::omp_set_dynamic
|
||||
!dec$ attributes alias:'OMP_SET_NESTED'::omp_set_nested
|
||||
!dec$ attributes alias:'OMP_GET_NUM_THREADS'::omp_get_num_threads
|
||||
!dec$ attributes alias:'OMP_GET_MAX_THREADS'::omp_get_max_threads
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_NUM'::omp_get_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_NUM_PROCS'::omp_get_num_procs
|
||||
!dec$ attributes alias:'OMP_IN_PARALLEL'::omp_in_parallel
|
||||
!dec$ attributes alias:'OMP_GET_DYNAMIC'::omp_get_dynamic
|
||||
!dec$ attributes alias:'OMP_GET_NESTED'::omp_get_nested
|
||||
!dec$ attributes alias:'OMP_GET_WTIME'::omp_get_wtime
|
||||
!dec$ attributes alias:'OMP_GET_WTICK'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock'::omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock'::omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock'::omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock'::omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'KMP_SET_DEFAULTS'::kmp_set_defaults
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ else
|
||||
|
||||
!***
|
||||
!*** On Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_OMP_SET_NUM_THREADS'::omp_set_num_threads
|
||||
!dec$ attributes alias:'_OMP_SET_DYNAMIC'::omp_set_dynamic
|
||||
!dec$ attributes alias:'_OMP_SET_NESTED'::omp_set_nested
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_THREADS'::omp_get_num_threads
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_THREADS'::omp_get_max_threads
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_NUM'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_PROCS'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_OMP_IN_PARALLEL'::omp_in_parallel
|
||||
!dec$ attributes alias:'_OMP_GET_DYNAMIC'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_OMP_GET_NESTED'::omp_get_nested
|
||||
!dec$ attributes alias:'_OMP_GET_WTIME'::omp_get_wtime
|
||||
!dec$ attributes alias:'_OMP_GET_WTICK'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock'::omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock'::omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock'::omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock'::omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'_KMP_SET_DEFAULTS'::kmp_set_defaults
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__linux)
|
||||
|
||||
!***
|
||||
!*** The Linux* OS entry points are in lowercase, with an underscore appended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'kmp_set_defaults_'::kmp_set_defaults
|
||||
!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__APPLE__)
|
||||
|
||||
!***
|
||||
!*** The Mac entry points are in lowercase, with an both an underscore
|
||||
!*** appended and an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'_kmp_set_defaults_'::kmp_set_defaults
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ endif
|
||||
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* include/30/iomp.h.var
|
||||
* $Revision: 42061 $
|
||||
* $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __IOMP_H
|
||||
# define __IOMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define kmp_set_stacksize kmpc_set_stacksize
|
||||
# define kmp_set_stacksize_s kmpc_set_stacksize_s
|
||||
# define kmp_set_blocktime kmpc_set_blocktime
|
||||
# define kmp_set_library kmpc_set_library
|
||||
# define kmp_set_defaults kmpc_set_defaults
|
||||
# define kmp_set_affinity_mask_proc kmpc_set_affinity_mask_proc
|
||||
# define kmp_unset_affinity_mask_proc kmpc_unset_affinity_mask_proc
|
||||
# define kmp_get_affinity_mask_proc kmpc_get_affinity_mask_proc
|
||||
|
||||
# define kmp_malloc kmpc_malloc
|
||||
# define kmp_calloc kmpc_calloc
|
||||
# define kmp_realloc kmpc_realloc
|
||||
# define kmp_free kmpc_free
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
|
||||
/* affinity API functions */
|
||||
typedef void * kmp_affinity_mask_t;
|
||||
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __IOMP_H */
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
! include/30/iomp_lib.h.var
|
||||
! $Revision: 42061 $
|
||||
! $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** omp_integer_kind and omp_logical_kind appear to be predefined by gcc and
|
||||
!*** gfortran (definitions do not appear in the omp.h / omp_lib.h /omp_lib.f).
|
||||
!*** omp_real_kind is not predefined, however.
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
|
||||
!***
|
||||
!*** kmp_* type extensions
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_pointer_kind = $KMP_INT_PTR_KIND
|
||||
integer, parameter :: kmp_size_t_kind = $KMP_INT_PTR_KIND
|
||||
integer, parameter :: kmp_affinity_mask_kind = $KMP_INT_PTR_KIND
|
||||
|
||||
!***
|
||||
!*** kmp_* entry points
|
||||
!***
|
||||
|
||||
external kmp_set_stacksize
|
||||
external kmp_set_stacksize_s
|
||||
external kmp_set_blocktime
|
||||
external kmp_set_library_serial
|
||||
external kmp_set_library_turnaround
|
||||
external kmp_set_library_throughput
|
||||
external kmp_set_library
|
||||
external kmp_set_defaults
|
||||
external kmp_get_stacksize
|
||||
integer kmp_get_stacksize
|
||||
external kmp_get_stacksize_s
|
||||
integer (kind = kmp_size_t_kind) kmp_get_stacksize_s
|
||||
external kmp_get_blocktime
|
||||
integer kmp_get_blocktime
|
||||
external kmp_get_library
|
||||
integer kmp_get_library
|
||||
external kmp_set_affinity
|
||||
integer kmp_set_affinity
|
||||
external kmp_get_affinity
|
||||
integer kmp_get_affinity
|
||||
external kmp_get_affinity_max_proc
|
||||
integer kmp_get_affinity_max_proc
|
||||
external kmp_create_affinity_mask
|
||||
external kmp_destroy_affinity_mask
|
||||
external kmp_set_affinity_mask_proc
|
||||
integer kmp_set_affinity_mask_proc
|
||||
external kmp_unset_affinity_mask_proc
|
||||
integer kmp_unset_affinity_mask_proc
|
||||
external kmp_get_affinity_mask_proc
|
||||
integer kmp_get_affinity_mask_proc
|
||||
external kmp_malloc
|
||||
integer (kind = kmp_pointer_kind) kmp_malloc
|
||||
external kmp_calloc
|
||||
integer (kind = kmp_pointer_kind) kmp_calloc
|
||||
external kmp_realloc
|
||||
integer (kind = kmp_pointer_kind) kmp_realloc
|
||||
external kmp_free
|
||||
|
||||
external kmp_set_warnings_on
|
||||
external kmp_set_warnings_off
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* include/30/omp.h.var
|
||||
* $Revision: 42061 $
|
||||
* $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
*/
|
||||
|
||||
|
||||
@@ -18,10 +16,10 @@
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
|
||||
# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
|
||||
# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -80,6 +78,7 @@
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_final (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
|
||||
@@ -142,6 +141,7 @@
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/30/omp_lib.f.var
|
||||
! $Revision: 42181 $
|
||||
! $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -38,11 +36,11 @@
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
@@ -325,6 +323,13 @@
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
integer (kind=kmp_size_t_kind) alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
@@ -418,6 +423,7 @@
|
||||
!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
@@ -484,6 +490,7 @@
|
||||
!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
@@ -553,6 +560,7 @@
|
||||
!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
@@ -622,6 +630,7 @@
|
||||
!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/30/omp_lib.f90.var
|
||||
! $Revision: 42061 $
|
||||
! $Date: 2013-02-28 16:36:24 -0600 (Thu, 28 Feb 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -34,12 +32,12 @@
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
@@ -92,6 +90,11 @@
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
@@ -325,6 +328,13 @@
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/30/omp_lib.h.var
|
||||
! $Revision: 42181 $
|
||||
! $Date: 2013-03-26 15:04:45 -0500 (Tue, 26 Mar 2013) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -35,12 +33,12 @@
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
|
||||
interface
|
||||
|
||||
@@ -88,6 +86,11 @@
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final()
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic()
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
@@ -318,6 +321,13 @@
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
integer (kind=kmp_size_t_kind) alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
@@ -366,6 +376,7 @@
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_NUM'::omp_get_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_NUM_PROCS'::omp_get_num_procs
|
||||
!dec$ attributes alias:'OMP_IN_PARALLEL'::omp_in_parallel
|
||||
!dec$ attributes alias:'OMP_IN_FINAL'::omp_in_final
|
||||
!dec$ attributes alias:'OMP_GET_DYNAMIC'::omp_get_dynamic
|
||||
!dec$ attributes alias:'OMP_GET_NESTED'::omp_get_nested
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_LIMIT'::omp_get_thread_limit
|
||||
@@ -412,6 +423,7 @@
|
||||
!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
@@ -433,6 +445,7 @@
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_NUM'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_PROCS'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_OMP_IN_PARALLEL'::omp_in_parallel
|
||||
!dec$ attributes alias:'_OMP_IN_FINAL'::omp_in_final
|
||||
!dec$ attributes alias:'_OMP_GET_DYNAMIC'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_OMP_GET_NESTED'::omp_get_nested
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT'::omp_get_thread_limit
|
||||
@@ -479,6 +492,7 @@
|
||||
!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
@@ -503,6 +517,7 @@
|
||||
!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'omp_in_final_'::omp_in_final
|
||||
!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
|
||||
@@ -549,6 +564,7 @@
|
||||
!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
@@ -573,6 +589,7 @@
|
||||
!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'_omp_in_final_'::omp_in_final
|
||||
!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
|
||||
@@ -619,6 +636,7 @@
|
||||
!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
@@ -0,0 +1,488 @@
|
||||
/*
|
||||
* include/30/ompt.h.var
|
||||
*/
|
||||
|
||||
#ifndef __OMPT__
|
||||
#define __OMPT__
|
||||
|
||||
/*****************************************************************************
|
||||
* system include files
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* iteration macros
|
||||
*****************************************************************************/
|
||||
|
||||
#define FOREACH_OMPT_INQUIRY_FN(macro) \
|
||||
macro (ompt_enumerate_state) \
|
||||
\
|
||||
macro (ompt_set_callback) \
|
||||
macro (ompt_get_callback) \
|
||||
\
|
||||
macro (ompt_get_idle_frame) \
|
||||
macro (ompt_get_task_frame) \
|
||||
\
|
||||
macro (ompt_get_state) \
|
||||
\
|
||||
macro (ompt_get_parallel_id) \
|
||||
macro (ompt_get_parallel_team_size) \
|
||||
macro (ompt_get_task_id) \
|
||||
macro (ompt_get_thread_id)
|
||||
|
||||
#define FOREACH_OMPT_PLACEHOLDER_FN(macro) \
|
||||
macro (ompt_idle) \
|
||||
macro (ompt_overhead) \
|
||||
macro (ompt_barrier_wait) \
|
||||
macro (ompt_task_wait) \
|
||||
macro (ompt_mutex_wait)
|
||||
|
||||
#define FOREACH_OMPT_STATE(macro) \
|
||||
\
|
||||
/* first */ \
|
||||
macro (ompt_state_first, 0x71) /* initial enumeration state */ \
|
||||
\
|
||||
/* work states (0..15) */ \
|
||||
macro (ompt_state_work_serial, 0x00) /* working outside parallel */ \
|
||||
macro (ompt_state_work_parallel, 0x01) /* working within parallel */ \
|
||||
macro (ompt_state_work_reduction, 0x02) /* performing a reduction */ \
|
||||
\
|
||||
/* idle (16..31) */ \
|
||||
macro (ompt_state_idle, 0x10) /* waiting for work */ \
|
||||
\
|
||||
/* overhead states (32..63) */ \
|
||||
macro (ompt_state_overhead, 0x20) /* overhead excluding wait states */ \
|
||||
\
|
||||
/* barrier wait states (64..79) */ \
|
||||
macro (ompt_state_wait_barrier, 0x40) /* waiting at a barrier */ \
|
||||
macro (ompt_state_wait_barrier_implicit, 0x41) /* implicit barrier */ \
|
||||
macro (ompt_state_wait_barrier_explicit, 0x42) /* explicit barrier */ \
|
||||
\
|
||||
/* task wait states (80..95) */ \
|
||||
macro (ompt_state_wait_taskwait, 0x50) /* waiting at a taskwait */ \
|
||||
macro (ompt_state_wait_taskgroup, 0x51) /* waiting at a taskgroup */ \
|
||||
\
|
||||
/* mutex wait states (96..111) */ \
|
||||
macro (ompt_state_wait_lock, 0x60) /* waiting for lock */ \
|
||||
macro (ompt_state_wait_nest_lock, 0x61) /* waiting for nest lock */ \
|
||||
macro (ompt_state_wait_critical, 0x62) /* waiting for critical */ \
|
||||
macro (ompt_state_wait_atomic, 0x63) /* waiting for atomic */ \
|
||||
macro (ompt_state_wait_ordered, 0x64) /* waiting for ordered */ \
|
||||
macro (ompt_state_wait_single, 0x6F) /* waiting for single region (non-standard!) */ \
|
||||
\
|
||||
/* misc (112..127) */ \
|
||||
macro (ompt_state_undefined, 0x70) /* undefined thread state */
|
||||
|
||||
|
||||
#define FOREACH_OMPT_EVENT(macro) \
|
||||
\
|
||||
/*--- Mandatory Events ---*/ \
|
||||
macro (ompt_event_parallel_begin, ompt_new_parallel_callback_t, 1) /* parallel begin */ \
|
||||
macro (ompt_event_parallel_end, ompt_end_parallel_callback_t, 2) /* parallel end */ \
|
||||
\
|
||||
macro (ompt_event_task_begin, ompt_new_task_callback_t, 3) /* task begin */ \
|
||||
macro (ompt_event_task_end, ompt_task_callback_t, 4) /* task destroy */ \
|
||||
\
|
||||
macro (ompt_event_thread_begin, ompt_thread_type_callback_t, 5) /* thread begin */ \
|
||||
macro (ompt_event_thread_end, ompt_thread_type_callback_t, 6) /* thread end */ \
|
||||
\
|
||||
macro (ompt_event_control, ompt_control_callback_t, 7) /* support control calls */ \
|
||||
\
|
||||
macro (ompt_event_runtime_shutdown, ompt_callback_t, 8) /* runtime shutdown */ \
|
||||
\
|
||||
/*--- Optional Events (blame shifting, ompt_event_unimplemented) ---*/ \
|
||||
macro (ompt_event_idle_begin, ompt_thread_callback_t, 9) /* begin idle state */ \
|
||||
macro (ompt_event_idle_end, ompt_thread_callback_t, 10) /* end idle state */ \
|
||||
\
|
||||
macro (ompt_event_wait_barrier_begin, ompt_parallel_callback_t, 11) /* begin wait at barrier */ \
|
||||
macro (ompt_event_wait_barrier_end, ompt_parallel_callback_t, 12) /* end wait at barrier */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskwait_begin, ompt_parallel_callback_t, 13) /* begin wait at taskwait */ \
|
||||
macro (ompt_event_wait_taskwait_end, ompt_parallel_callback_t, 14) /* end wait at taskwait */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskgroup_begin, ompt_parallel_callback_t, 15) /* begin wait at taskgroup */\
|
||||
macro (ompt_event_wait_taskgroup_end, ompt_parallel_callback_t, 16) /* end wait at taskgroup */ \
|
||||
\
|
||||
macro (ompt_event_release_lock, ompt_wait_callback_t, 17) /* lock release */ \
|
||||
macro (ompt_event_release_nest_lock_last, ompt_wait_callback_t, 18) /* last nest lock release */ \
|
||||
macro (ompt_event_release_critical, ompt_wait_callback_t, 19) /* critical release */ \
|
||||
\
|
||||
macro (ompt_event_release_atomic, ompt_wait_callback_t, 20) /* atomic release */ \
|
||||
\
|
||||
macro (ompt_event_release_ordered, ompt_wait_callback_t, 21) /* ordered release */ \
|
||||
\
|
||||
/*--- Optional Events (synchronous events, ompt_event_unimplemented) --- */ \
|
||||
macro (ompt_event_implicit_task_begin, ompt_parallel_callback_t, 22) /* implicit task begin */ \
|
||||
macro (ompt_event_implicit_task_end, ompt_parallel_callback_t, 23) /* implicit task end */ \
|
||||
\
|
||||
macro (ompt_event_initial_task_begin, ompt_parallel_callback_t, 24) /* initial task begin */ \
|
||||
macro (ompt_event_initial_task_end, ompt_parallel_callback_t, 25) /* initial task end */ \
|
||||
\
|
||||
macro (ompt_event_task_switch, ompt_task_pair_callback_t, 26) /* task switch */ \
|
||||
\
|
||||
macro (ompt_event_loop_begin, ompt_new_workshare_callback_t, 27) /* task at loop begin */ \
|
||||
macro (ompt_event_loop_end, ompt_parallel_callback_t, 28) /* task at loop end */ \
|
||||
\
|
||||
macro (ompt_event_sections_begin, ompt_new_workshare_callback_t, 29) /* task at sections begin */\
|
||||
macro (ompt_event_sections_end, ompt_parallel_callback_t, 30) /* task at sections end */ \
|
||||
\
|
||||
macro (ompt_event_single_in_block_begin, ompt_new_workshare_callback_t, 31) /* task at single begin*/ \
|
||||
macro (ompt_event_single_in_block_end, ompt_parallel_callback_t, 32) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_single_others_begin, ompt_parallel_callback_t, 33) /* task at single begin */ \
|
||||
macro (ompt_event_single_others_end, ompt_parallel_callback_t, 34) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_workshare_begin, ompt_new_workshare_callback_t, 35) /* task at workshare begin */\
|
||||
macro (ompt_event_workshare_end, ompt_parallel_callback_t, 36) /* task at workshare end */ \
|
||||
\
|
||||
macro (ompt_event_master_begin, ompt_parallel_callback_t, 37) /* task at master begin */ \
|
||||
macro (ompt_event_master_end, ompt_parallel_callback_t, 38) /* task at master end */ \
|
||||
\
|
||||
macro (ompt_event_barrier_begin, ompt_parallel_callback_t, 39) /* task at barrier begin */ \
|
||||
macro (ompt_event_barrier_end, ompt_parallel_callback_t, 40) /* task at barrier end */ \
|
||||
\
|
||||
macro (ompt_event_taskwait_begin, ompt_parallel_callback_t, 41) /* task at taskwait begin */ \
|
||||
macro (ompt_event_taskwait_end, ompt_parallel_callback_t, 42) /* task at task wait end */ \
|
||||
\
|
||||
macro (ompt_event_taskgroup_begin, ompt_parallel_callback_t, 43) /* task at taskgroup begin */\
|
||||
macro (ompt_event_taskgroup_end, ompt_parallel_callback_t, 44) /* task at taskgroup end */ \
|
||||
\
|
||||
macro (ompt_event_release_nest_lock_prev, ompt_wait_callback_t, 45) /* prev nest lock release */ \
|
||||
\
|
||||
macro (ompt_event_wait_lock, ompt_wait_callback_t, 46) /* lock wait */ \
|
||||
macro (ompt_event_wait_nest_lock, ompt_wait_callback_t, 47) /* nest lock wait */ \
|
||||
macro (ompt_event_wait_critical, ompt_wait_callback_t, 48) /* critical wait */ \
|
||||
macro (ompt_event_wait_atomic, ompt_wait_callback_t, 49) /* atomic wait */ \
|
||||
macro (ompt_event_wait_ordered, ompt_wait_callback_t, 50) /* ordered wait */ \
|
||||
\
|
||||
macro (ompt_event_acquired_lock, ompt_wait_callback_t, 51) /* lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_first, ompt_wait_callback_t, 52) /* 1st nest lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_next, ompt_wait_callback_t, 53) /* next nest lock acquired*/ \
|
||||
macro (ompt_event_acquired_critical, ompt_wait_callback_t, 54) /* critical acquired */ \
|
||||
macro (ompt_event_acquired_atomic, ompt_wait_callback_t, 55) /* atomic acquired */ \
|
||||
macro (ompt_event_acquired_ordered, ompt_wait_callback_t, 56) /* ordered acquired */ \
|
||||
\
|
||||
macro (ompt_event_init_lock, ompt_wait_callback_t, 57) /* lock init */ \
|
||||
macro (ompt_event_init_nest_lock, ompt_wait_callback_t, 58) /* nest lock init */ \
|
||||
\
|
||||
macro (ompt_event_destroy_lock, ompt_wait_callback_t, 59) /* lock destruction */ \
|
||||
macro (ompt_event_destroy_nest_lock, ompt_wait_callback_t, 60) /* nest lock destruction */ \
|
||||
\
|
||||
macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* data types
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* identifiers
|
||||
*---------------------*/
|
||||
|
||||
typedef uint64_t ompt_thread_id_t;
|
||||
#define ompt_thread_id_none ((ompt_thread_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_task_id_t;
|
||||
#define ompt_task_id_none ((ompt_task_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_parallel_id_t;
|
||||
#define ompt_parallel_id_none ((ompt_parallel_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_wait_id_t;
|
||||
#define ompt_wait_id_none ((ompt_wait_id_t) 0) /* non-standard */
|
||||
|
||||
|
||||
/*---------------------
|
||||
* ompt_frame_t
|
||||
*---------------------*/
|
||||
|
||||
typedef struct ompt_frame_s {
|
||||
void *exit_runtime_frame; /* next frame is user code */
|
||||
void *reenter_runtime_frame; /* previous frame is user code */
|
||||
} ompt_frame_t;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* enumerations for thread states and runtime events
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* runtime states
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_state_macro(state, code) state = code,
|
||||
FOREACH_OMPT_STATE(ompt_state_macro)
|
||||
#undef ompt_state_macro
|
||||
} ompt_state_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* runtime events
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_event_macro(event, callback, eventid) event = eventid,
|
||||
FOREACH_OMPT_EVENT(ompt_event_macro)
|
||||
#undef ompt_event_macro
|
||||
} ompt_event_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* set callback results
|
||||
*---------------------*/
|
||||
typedef enum {
|
||||
ompt_set_result_registration_error = 0,
|
||||
ompt_set_result_event_may_occur_no_callback = 1,
|
||||
ompt_set_result_event_never_occurs = 2,
|
||||
ompt_set_result_event_may_occur_callback_some = 3,
|
||||
ompt_set_result_event_may_occur_callback_always = 4,
|
||||
} ompt_set_result_t;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* callback signatures
|
||||
*****************************************************************************/
|
||||
|
||||
/* initialization */
|
||||
typedef void (*ompt_interface_fn_t)(void);
|
||||
|
||||
typedef ompt_interface_fn_t (*ompt_function_lookup_t)(
|
||||
const char * /* entry point to look up */
|
||||
);
|
||||
|
||||
/* threads */
|
||||
typedef void (*ompt_thread_callback_t) (
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
ompt_thread_initial = 1, // start the enumeration at 1
|
||||
ompt_thread_worker = 2,
|
||||
ompt_thread_other = 3
|
||||
} ompt_thread_type_t;
|
||||
|
||||
typedef enum {
|
||||
ompt_invoker_program = 0, /* program invokes master task */
|
||||
ompt_invoker_runtime = 1 /* runtime invokes master task */
|
||||
} ompt_invoker_t;
|
||||
|
||||
typedef void (*ompt_thread_type_callback_t) (
|
||||
ompt_thread_type_t thread_type, /* type of thread */
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef void (*ompt_wait_callback_t) (
|
||||
ompt_wait_id_t wait_id /* wait id */
|
||||
);
|
||||
|
||||
/* parallel and workshares */
|
||||
typedef void (*ompt_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_workshare_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
void *workshare_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_parallel_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data of parent task */
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
uint32_t requested_team_size, /* number of threads in team */
|
||||
void *parallel_function, /* pointer to outlined function */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
typedef void (*ompt_end_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id, /* id of task */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
/* tasks */
|
||||
typedef void (*ompt_task_callback_t) (
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_task_pair_callback_t) (
|
||||
ompt_task_id_t first_task_id,
|
||||
ompt_task_id_t second_task_id
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_task_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data for parent task */
|
||||
ompt_task_id_t new_task_id, /* id of created task */
|
||||
void *task_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
/* program */
|
||||
typedef void (*ompt_control_callback_t) (
|
||||
uint64_t command, /* command of control call */
|
||||
uint64_t modifier /* modifier of control call */
|
||||
);
|
||||
|
||||
typedef void (*ompt_callback_t)(void);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* ompt API
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OMPT_API_FNTYPE(fn) fn##_t
|
||||
|
||||
#define OMPT_API_FUNCTION(return_type, fn, args) \
|
||||
typedef return_type (*OMPT_API_FNTYPE(fn)) args
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INQUIRY FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* state */
|
||||
OMPT_API_FUNCTION(ompt_state_t, ompt_get_state, (
|
||||
ompt_wait_id_t *ompt_wait_id
|
||||
));
|
||||
|
||||
/* thread */
|
||||
OMPT_API_FUNCTION(ompt_thread_id_t, ompt_get_thread_id, (void));
|
||||
|
||||
OMPT_API_FUNCTION(void *, ompt_get_idle_frame, (void));
|
||||
|
||||
/* parallel region */
|
||||
OMPT_API_FUNCTION(ompt_parallel_id_t, ompt_get_parallel_id, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_parallel_team_size, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
/* task */
|
||||
OMPT_API_FUNCTION(ompt_task_id_t, ompt_get_task_id, (
|
||||
int depth
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(ompt_frame_t *, ompt_get_task_frame, (
|
||||
int depth
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PLACEHOLDERS FOR PERFORMANCE REPORTING
|
||||
***************************************************************************/
|
||||
|
||||
/* idle */
|
||||
OMPT_API_FUNCTION(void, ompt_idle, (
|
||||
void
|
||||
));
|
||||
|
||||
/* overhead */
|
||||
OMPT_API_FUNCTION(void, ompt_overhead, (
|
||||
void
|
||||
));
|
||||
|
||||
/* barrier wait */
|
||||
OMPT_API_FUNCTION(void, ompt_barrier_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* task wait */
|
||||
OMPT_API_FUNCTION(void, ompt_task_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* mutex wait */
|
||||
OMPT_API_FUNCTION(void, ompt_mutex_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INITIALIZATION FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
OMPT_API_FUNCTION(void, ompt_initialize, (
|
||||
ompt_function_lookup_t ompt_fn_lookup,
|
||||
const char *runtime_version,
|
||||
unsigned int ompt_version
|
||||
));
|
||||
|
||||
|
||||
/* initialization interface to be defined by tool */
|
||||
ompt_initialize_t ompt_tool(void);
|
||||
|
||||
typedef enum opt_init_mode_e {
|
||||
ompt_init_mode_never = 0,
|
||||
ompt_init_mode_false = 1,
|
||||
ompt_init_mode_true = 2,
|
||||
ompt_init_mode_always = 3
|
||||
} ompt_init_mode_t;
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_set_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t callback
|
||||
));
|
||||
|
||||
typedef enum ompt_set_callback_rc_e { /* non-standard */
|
||||
ompt_set_callback_error = 0,
|
||||
ompt_has_event_no_callback = 1,
|
||||
ompt_no_event_no_callback = 2,
|
||||
ompt_has_event_may_callback = 3,
|
||||
ompt_has_event_must_callback = 4,
|
||||
} ompt_set_callback_rc_t;
|
||||
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t *callback
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* MISCELLANEOUS FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* control */
|
||||
// FIXME: remove workaround for clang
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp declare target
|
||||
#endif
|
||||
void ompt_control(
|
||||
uint64_t command,
|
||||
uint64_t modifier
|
||||
);
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp end declare target
|
||||
#endif
|
||||
|
||||
/* state enumeration */
|
||||
OMPT_API_FUNCTION(int, ompt_enumerate_state, (
|
||||
int current_state,
|
||||
int *next_state,
|
||||
const char **next_state_name
|
||||
));
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* include/40/iomp.h.var
|
||||
* $Revision: 41674 $
|
||||
* $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __IOMP_H
|
||||
# define __IOMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# define kmp_set_stacksize kmpc_set_stacksize
|
||||
# define kmp_set_stacksize_s kmpc_set_stacksize_s
|
||||
# define kmp_set_blocktime kmpc_set_blocktime
|
||||
# define kmp_set_library kmpc_set_library
|
||||
# define kmp_set_defaults kmpc_set_defaults
|
||||
# define kmp_set_affinity_mask_proc kmpc_set_affinity_mask_proc
|
||||
# define kmp_unset_affinity_mask_proc kmpc_unset_affinity_mask_proc
|
||||
# define kmp_get_affinity_mask_proc kmpc_get_affinity_mask_proc
|
||||
|
||||
# define kmp_malloc kmpc_malloc
|
||||
# define kmp_calloc kmpc_calloc
|
||||
# define kmp_realloc kmpc_realloc
|
||||
# define kmp_free kmpc_free
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
|
||||
/* affinity API functions */
|
||||
typedef void * kmp_affinity_mask_t;
|
||||
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
/* schedule kind constants */
|
||||
typedef enum kmp_cancel_kind_t {
|
||||
kmp_cancel_parallel = 1,
|
||||
kmp_cancel_loop = 2,
|
||||
kmp_cancel_sections = 3,
|
||||
kmp_cancel_taskgroup = 4
|
||||
} kmp_cancel_kind_t;
|
||||
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_cancellation_status(kmp_cancel_kind_t);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __IOMP_H */
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
! include/40/iomp_lib.h.var
|
||||
! $Revision: 41674 $
|
||||
! $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** omp_integer_kind and omp_logical_kind appear to be predefined by gcc and
|
||||
!*** gfortran (definitions do not appear in the omp.h / omp_lib.h /omp_lib.f).
|
||||
!*** omp_real_kind is not predefined, however.
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer, parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer, parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
|
||||
!***
|
||||
!*** kmp_* type extensions
|
||||
!***
|
||||
|
||||
integer, parameter :: kmp_pointer_kind = $KMP_INT_PTR_KIND
|
||||
integer, parameter :: kmp_size_t_kind = $KMP_INT_PTR_KIND
|
||||
integer, parameter :: kmp_affinity_mask_kind = $KMP_INT_PTR_KIND
|
||||
|
||||
!***
|
||||
!*** kmp_* entry points
|
||||
!***
|
||||
|
||||
external kmp_set_stacksize
|
||||
external kmp_set_stacksize_s
|
||||
external kmp_set_blocktime
|
||||
external kmp_set_library_serial
|
||||
external kmp_set_library_turnaround
|
||||
external kmp_set_library_throughput
|
||||
external kmp_set_library
|
||||
external kmp_set_defaults
|
||||
external kmp_get_stacksize
|
||||
integer kmp_get_stacksize
|
||||
external kmp_get_stacksize_s
|
||||
integer (kind = kmp_size_t_kind) kmp_get_stacksize_s
|
||||
external kmp_get_blocktime
|
||||
integer kmp_get_blocktime
|
||||
external kmp_get_library
|
||||
integer kmp_get_library
|
||||
external kmp_set_affinity
|
||||
integer kmp_set_affinity
|
||||
external kmp_get_affinity
|
||||
integer kmp_get_affinity
|
||||
external kmp_get_affinity_max_proc
|
||||
integer kmp_get_affinity_max_proc
|
||||
external kmp_create_affinity_mask
|
||||
external kmp_destroy_affinity_mask
|
||||
external kmp_set_affinity_mask_proc
|
||||
integer kmp_set_affinity_mask_proc
|
||||
external kmp_unset_affinity_mask_proc
|
||||
integer kmp_unset_affinity_mask_proc
|
||||
external kmp_get_affinity_mask_proc
|
||||
integer kmp_get_affinity_mask_proc
|
||||
external kmp_malloc
|
||||
integer (kind = kmp_pointer_kind) kmp_malloc
|
||||
external kmp_calloc
|
||||
integer (kind = kmp_pointer_kind) kmp_calloc
|
||||
external kmp_realloc
|
||||
integer (kind = kmp_pointer_kind) kmp_realloc
|
||||
external kmp_free
|
||||
|
||||
external kmp_set_warnings_on
|
||||
external kmp_set_warnings_off
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* include/40/omp.h.var
|
||||
* $Revision: 41674 $
|
||||
* $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
*/
|
||||
|
||||
|
||||
@@ -18,10 +16,10 @@
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR $KMP_VERSION_MAJOR
|
||||
# define KMP_VERSION_MINOR $KMP_VERSION_MINOR
|
||||
# define KMP_VERSION_BUILD $KMP_VERSION_BUILD
|
||||
# define KMP_BUILD_DATE "$KMP_BUILD_DATE"
|
||||
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
|
||||
# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
|
||||
# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -56,6 +54,7 @@
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_final (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
|
||||
@@ -93,6 +92,7 @@
|
||||
/* OpenMP 4.0 */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_default_device (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_default_device (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_is_initial_device (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_devices (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_teams (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
|
||||
@@ -137,6 +137,7 @@
|
||||
extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/40/omp_lib.f.var
|
||||
! $Revision: 41674 $
|
||||
! $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -40,11 +38,11 @@
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
character(*), parameter :: kmp_build_date = '$KMP_BUILD_DATE'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
@@ -68,19 +66,19 @@
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads)
|
||||
subroutine omp_set_num_threads(num_threads)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) nthreads
|
||||
integer (kind=omp_integer_kind) num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable)
|
||||
subroutine omp_set_dynamic(dynamic_threads)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) enable
|
||||
logical (kind=omp_logical_kind) dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable)
|
||||
subroutine omp_set_nested(nested)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) enable
|
||||
logical (kind=omp_logical_kind) nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads()
|
||||
@@ -108,6 +106,11 @@
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
@@ -155,16 +158,16 @@
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, modifier)
|
||||
subroutine omp_set_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) modifier
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, modifier)
|
||||
subroutine omp_get_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) modifier
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind()
|
||||
@@ -185,9 +188,9 @@
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(dflt_device)
|
||||
subroutine omp_set_default_device(device_num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) dflt_device
|
||||
integer (kind=omp_integer_kind) device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices()
|
||||
@@ -210,86 +213,91 @@
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
subroutine omp_init_lock(lockvar)
|
||||
function omp_is_initial_device()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar)
|
||||
subroutine omp_destroy_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar)
|
||||
subroutine omp_set_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar)
|
||||
subroutine omp_unset_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar)
|
||||
function omp_test_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar)
|
||||
subroutine omp_init_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar)
|
||||
subroutine omp_destroy_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar)
|
||||
subroutine omp_set_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar)
|
||||
subroutine omp_unset_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar)
|
||||
function omp_test_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
@@ -403,6 +411,13 @@
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
integer (kind=kmp_size_t_kind) alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
@@ -433,6 +448,7 @@
|
||||
integer (kind=kmp_cancel_kind) cancelkind
|
||||
logical (kind=omp_logical_kind) kmp_get_cancellation_status
|
||||
end function kmp_get_cancellation_status
|
||||
|
||||
end interface
|
||||
|
||||
!dec$ if defined(_WIN32)
|
||||
@@ -476,6 +492,7 @@
|
||||
!dec$ attributes alias:'OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
|
||||
@@ -508,6 +525,7 @@
|
||||
!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
@@ -551,6 +569,7 @@
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'_OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'_OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'_OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
|
||||
@@ -583,6 +602,7 @@
|
||||
!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
@@ -629,6 +649,7 @@
|
||||
!dec$ attributes alias:'omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'omp_is_initial_device_'::omp_is_initial_device
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
|
||||
@@ -661,6 +682,7 @@
|
||||
!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
@@ -703,6 +725,7 @@
|
||||
!dec$ attributes alias:'_omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'_omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'_omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'_omp_is_initial_device_'::omp_is_initial_device
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
|
||||
@@ -735,6 +758,7 @@
|
||||
!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/40/omp_lib.f90.var
|
||||
! $Revision: 41674 $
|
||||
! $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -36,12 +34,12 @@
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
@@ -66,19 +64,19 @@
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads) bind(c)
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: nthreads
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable) bind(c)
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable) bind(c)
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
@@ -106,6 +104,11 @@
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
@@ -153,16 +156,16 @@
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, modifier) bind(c)
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: modifier
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, modifier) bind(c)
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) modifier
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
@@ -185,9 +188,9 @@
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(dflt_device) bind(c)
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: dflt_device
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
@@ -210,86 +213,91 @@
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
subroutine omp_init_lock(lockvar) bind(c)
|
||||
function omp_is_initial_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar) bind(c)
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar) bind(c)
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar) bind(c)
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar) bind(c)
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar) bind(c)
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
@@ -404,6 +412,13 @@
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
! include/40/omp_lib.h.var
|
||||
! $Revision: 41674 $
|
||||
! $Date: 2012-06-05 08:33:35 -0500 (Tue, 05 Jun 2012) $
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
@@ -31,12 +29,12 @@
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = $OMP_VERSION
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = $KMP_VERSION_MAJOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = $KMP_VERSION_MINOR
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = $KMP_VERSION_BUILD
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '$KMP_BUILD_DATE' )
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
@@ -55,19 +53,19 @@
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(nthreads) bind(c)
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: nthreads
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(enable) bind(c)
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(enable) bind(c)
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: enable
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
@@ -95,6 +93,11 @@
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
@@ -142,16 +145,16 @@
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, modifier) bind(c)
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: modifier
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, modifier) bind(c)
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) modifier
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
@@ -172,9 +175,9 @@
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(dflt_device) bind(c)
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: dflt_device
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
@@ -192,86 +195,91 @@
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
subroutine omp_init_lock(lockvar) bind(c)
|
||||
function omp_is_initial_device() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(lockvar) bind(c)
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(lockvar) bind(c)
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(lockvar) bind(c)
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(lockvar) bind(c)
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) lockvar
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(lockvar) bind(c)
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(lockvar) bind(c)
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) lockvar
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
! ***
|
||||
@@ -385,6 +393,13 @@
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
@@ -421,6 +436,7 @@
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_procs
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_parallel
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_final
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_dynamic
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_nested
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_limit
|
||||
@@ -437,6 +453,7 @@
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtick
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_is_initial_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
|
||||
@@ -471,6 +488,7 @@
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_unset_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_aligned_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_calloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_realloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_free
|
||||
@@ -486,6 +504,7 @@
|
||||
!$omp declare target(omp_get_thread_num )
|
||||
!$omp declare target(omp_get_num_procs )
|
||||
!$omp declare target(omp_in_parallel )
|
||||
!$omp declare target(omp_in_final )
|
||||
!$omp declare target(omp_get_dynamic )
|
||||
!$omp declare target(omp_get_nested )
|
||||
!$omp declare target(omp_get_thread_limit )
|
||||
@@ -502,6 +521,7 @@
|
||||
!$omp declare target(omp_get_wtick )
|
||||
!$omp declare target(omp_get_default_device )
|
||||
!$omp declare target(omp_set_default_device )
|
||||
!$omp declare target(omp_is_initial_device )
|
||||
!$omp declare target(omp_get_num_devices )
|
||||
!$omp declare target(omp_get_num_teams )
|
||||
!$omp declare target(omp_get_team_num )
|
||||
@@ -536,6 +556,7 @@
|
||||
!$omp declare target(kmp_unset_affinity_mask_proc )
|
||||
!$omp declare target(kmp_get_affinity_mask_proc )
|
||||
!$omp declare target(kmp_malloc )
|
||||
!$omp declare target(kmp_aligned_malloc )
|
||||
!$omp declare target(kmp_calloc )
|
||||
!$omp declare target(kmp_realloc )
|
||||
!$omp declare target(kmp_free )
|
||||
|
||||
@@ -0,0 +1,515 @@
|
||||
/*
|
||||
* include/40/ompt.h.var
|
||||
*/
|
||||
|
||||
#ifndef __OMPT__
|
||||
#define __OMPT__
|
||||
|
||||
/*****************************************************************************
|
||||
* system include files
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* iteration macros
|
||||
*****************************************************************************/
|
||||
|
||||
#define FOREACH_OMPT_INQUIRY_FN(macro) \
|
||||
macro (ompt_enumerate_state) \
|
||||
\
|
||||
macro (ompt_set_callback) \
|
||||
macro (ompt_get_callback) \
|
||||
\
|
||||
macro (ompt_get_idle_frame) \
|
||||
macro (ompt_get_task_frame) \
|
||||
\
|
||||
macro (ompt_get_state) \
|
||||
\
|
||||
macro (ompt_get_parallel_id) \
|
||||
macro (ompt_get_parallel_team_size) \
|
||||
macro (ompt_get_task_id) \
|
||||
macro (ompt_get_thread_id)
|
||||
|
||||
#define FOREACH_OMPT_PLACEHOLDER_FN(macro) \
|
||||
macro (ompt_idle) \
|
||||
macro (ompt_overhead) \
|
||||
macro (ompt_barrier_wait) \
|
||||
macro (ompt_task_wait) \
|
||||
macro (ompt_mutex_wait)
|
||||
|
||||
#define FOREACH_OMPT_STATE(macro) \
|
||||
\
|
||||
/* first */ \
|
||||
macro (ompt_state_first, 0x71) /* initial enumeration state */ \
|
||||
\
|
||||
/* work states (0..15) */ \
|
||||
macro (ompt_state_work_serial, 0x00) /* working outside parallel */ \
|
||||
macro (ompt_state_work_parallel, 0x01) /* working within parallel */ \
|
||||
macro (ompt_state_work_reduction, 0x02) /* performing a reduction */ \
|
||||
\
|
||||
/* idle (16..31) */ \
|
||||
macro (ompt_state_idle, 0x10) /* waiting for work */ \
|
||||
\
|
||||
/* overhead states (32..63) */ \
|
||||
macro (ompt_state_overhead, 0x20) /* overhead excluding wait states */ \
|
||||
\
|
||||
/* barrier wait states (64..79) */ \
|
||||
macro (ompt_state_wait_barrier, 0x40) /* waiting at a barrier */ \
|
||||
macro (ompt_state_wait_barrier_implicit, 0x41) /* implicit barrier */ \
|
||||
macro (ompt_state_wait_barrier_explicit, 0x42) /* explicit barrier */ \
|
||||
\
|
||||
/* task wait states (80..95) */ \
|
||||
macro (ompt_state_wait_taskwait, 0x50) /* waiting at a taskwait */ \
|
||||
macro (ompt_state_wait_taskgroup, 0x51) /* waiting at a taskgroup */ \
|
||||
\
|
||||
/* mutex wait states (96..111) */ \
|
||||
macro (ompt_state_wait_lock, 0x60) /* waiting for lock */ \
|
||||
macro (ompt_state_wait_nest_lock, 0x61) /* waiting for nest lock */ \
|
||||
macro (ompt_state_wait_critical, 0x62) /* waiting for critical */ \
|
||||
macro (ompt_state_wait_atomic, 0x63) /* waiting for atomic */ \
|
||||
macro (ompt_state_wait_ordered, 0x64) /* waiting for ordered */ \
|
||||
macro (ompt_state_wait_single, 0x6F) /* waiting for single region (non-standard!) */ \
|
||||
\
|
||||
/* misc (112..127) */ \
|
||||
macro (ompt_state_undefined, 0x70) /* undefined thread state */
|
||||
|
||||
|
||||
#define FOREACH_OMPT_EVENT(macro) \
|
||||
\
|
||||
/*--- Mandatory Events ---*/ \
|
||||
macro (ompt_event_parallel_begin, ompt_new_parallel_callback_t, 1) /* parallel begin */ \
|
||||
macro (ompt_event_parallel_end, ompt_end_parallel_callback_t, 2) /* parallel end */ \
|
||||
\
|
||||
macro (ompt_event_task_begin, ompt_new_task_callback_t, 3) /* task begin */ \
|
||||
macro (ompt_event_task_end, ompt_task_callback_t, 4) /* task destroy */ \
|
||||
\
|
||||
macro (ompt_event_thread_begin, ompt_thread_type_callback_t, 5) /* thread begin */ \
|
||||
macro (ompt_event_thread_end, ompt_thread_type_callback_t, 6) /* thread end */ \
|
||||
\
|
||||
macro (ompt_event_control, ompt_control_callback_t, 7) /* support control calls */ \
|
||||
\
|
||||
macro (ompt_event_runtime_shutdown, ompt_callback_t, 8) /* runtime shutdown */ \
|
||||
\
|
||||
/*--- Optional Events (blame shifting, ompt_event_unimplemented) ---*/ \
|
||||
macro (ompt_event_idle_begin, ompt_thread_callback_t, 9) /* begin idle state */ \
|
||||
macro (ompt_event_idle_end, ompt_thread_callback_t, 10) /* end idle state */ \
|
||||
\
|
||||
macro (ompt_event_wait_barrier_begin, ompt_parallel_callback_t, 11) /* begin wait at barrier */ \
|
||||
macro (ompt_event_wait_barrier_end, ompt_parallel_callback_t, 12) /* end wait at barrier */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskwait_begin, ompt_parallel_callback_t, 13) /* begin wait at taskwait */ \
|
||||
macro (ompt_event_wait_taskwait_end, ompt_parallel_callback_t, 14) /* end wait at taskwait */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskgroup_begin, ompt_parallel_callback_t, 15) /* begin wait at taskgroup */\
|
||||
macro (ompt_event_wait_taskgroup_end, ompt_parallel_callback_t, 16) /* end wait at taskgroup */ \
|
||||
\
|
||||
macro (ompt_event_release_lock, ompt_wait_callback_t, 17) /* lock release */ \
|
||||
macro (ompt_event_release_nest_lock_last, ompt_wait_callback_t, 18) /* last nest lock release */ \
|
||||
macro (ompt_event_release_critical, ompt_wait_callback_t, 19) /* critical release */ \
|
||||
\
|
||||
macro (ompt_event_release_atomic, ompt_wait_callback_t, 20) /* atomic release */ \
|
||||
\
|
||||
macro (ompt_event_release_ordered, ompt_wait_callback_t, 21) /* ordered release */ \
|
||||
\
|
||||
/*--- Optional Events (synchronous events, ompt_event_unimplemented) --- */ \
|
||||
macro (ompt_event_implicit_task_begin, ompt_parallel_callback_t, 22) /* implicit task begin */ \
|
||||
macro (ompt_event_implicit_task_end, ompt_parallel_callback_t, 23) /* implicit task end */ \
|
||||
\
|
||||
macro (ompt_event_initial_task_begin, ompt_parallel_callback_t, 24) /* initial task begin */ \
|
||||
macro (ompt_event_initial_task_end, ompt_parallel_callback_t, 25) /* initial task end */ \
|
||||
\
|
||||
macro (ompt_event_task_switch, ompt_task_pair_callback_t, 26) /* task switch */ \
|
||||
\
|
||||
macro (ompt_event_loop_begin, ompt_new_workshare_callback_t, 27) /* task at loop begin */ \
|
||||
macro (ompt_event_loop_end, ompt_parallel_callback_t, 28) /* task at loop end */ \
|
||||
\
|
||||
macro (ompt_event_sections_begin, ompt_new_workshare_callback_t, 29) /* task at sections begin */\
|
||||
macro (ompt_event_sections_end, ompt_parallel_callback_t, 30) /* task at sections end */ \
|
||||
\
|
||||
macro (ompt_event_single_in_block_begin, ompt_new_workshare_callback_t, 31) /* task at single begin*/ \
|
||||
macro (ompt_event_single_in_block_end, ompt_parallel_callback_t, 32) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_single_others_begin, ompt_parallel_callback_t, 33) /* task at single begin */ \
|
||||
macro (ompt_event_single_others_end, ompt_parallel_callback_t, 34) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_workshare_begin, ompt_new_workshare_callback_t, 35) /* task at workshare begin */\
|
||||
macro (ompt_event_workshare_end, ompt_parallel_callback_t, 36) /* task at workshare end */ \
|
||||
\
|
||||
macro (ompt_event_master_begin, ompt_parallel_callback_t, 37) /* task at master begin */ \
|
||||
macro (ompt_event_master_end, ompt_parallel_callback_t, 38) /* task at master end */ \
|
||||
\
|
||||
macro (ompt_event_barrier_begin, ompt_parallel_callback_t, 39) /* task at barrier begin */ \
|
||||
macro (ompt_event_barrier_end, ompt_parallel_callback_t, 40) /* task at barrier end */ \
|
||||
\
|
||||
macro (ompt_event_taskwait_begin, ompt_parallel_callback_t, 41) /* task at taskwait begin */ \
|
||||
macro (ompt_event_taskwait_end, ompt_parallel_callback_t, 42) /* task at task wait end */ \
|
||||
\
|
||||
macro (ompt_event_taskgroup_begin, ompt_parallel_callback_t, 43) /* task at taskgroup begin */\
|
||||
macro (ompt_event_taskgroup_end, ompt_parallel_callback_t, 44) /* task at taskgroup end */ \
|
||||
\
|
||||
macro (ompt_event_release_nest_lock_prev, ompt_wait_callback_t, 45) /* prev nest lock release */ \
|
||||
\
|
||||
macro (ompt_event_wait_lock, ompt_wait_callback_t, 46) /* lock wait */ \
|
||||
macro (ompt_event_wait_nest_lock, ompt_wait_callback_t, 47) /* nest lock wait */ \
|
||||
macro (ompt_event_wait_critical, ompt_wait_callback_t, 48) /* critical wait */ \
|
||||
macro (ompt_event_wait_atomic, ompt_wait_callback_t, 49) /* atomic wait */ \
|
||||
macro (ompt_event_wait_ordered, ompt_wait_callback_t, 50) /* ordered wait */ \
|
||||
\
|
||||
macro (ompt_event_acquired_lock, ompt_wait_callback_t, 51) /* lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_first, ompt_wait_callback_t, 52) /* 1st nest lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_next, ompt_wait_callback_t, 53) /* next nest lock acquired*/ \
|
||||
macro (ompt_event_acquired_critical, ompt_wait_callback_t, 54) /* critical acquired */ \
|
||||
macro (ompt_event_acquired_atomic, ompt_wait_callback_t, 55) /* atomic acquired */ \
|
||||
macro (ompt_event_acquired_ordered, ompt_wait_callback_t, 56) /* ordered acquired */ \
|
||||
\
|
||||
macro (ompt_event_init_lock, ompt_wait_callback_t, 57) /* lock init */ \
|
||||
macro (ompt_event_init_nest_lock, ompt_wait_callback_t, 58) /* nest lock init */ \
|
||||
\
|
||||
macro (ompt_event_destroy_lock, ompt_wait_callback_t, 59) /* lock destruction */ \
|
||||
macro (ompt_event_destroy_nest_lock, ompt_wait_callback_t, 60) /* nest lock destruction */ \
|
||||
\
|
||||
macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */ \
|
||||
\
|
||||
macro (ompt_event_task_dependences, ompt_task_dependences_callback_t, 69) /* report task dependences */\
|
||||
macro (ompt_event_task_dependence_pair, ompt_task_pair_callback_t, 70) /* report task dependence pair */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* data types
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* identifiers
|
||||
*---------------------*/
|
||||
|
||||
typedef uint64_t ompt_thread_id_t;
|
||||
#define ompt_thread_id_none ((ompt_thread_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_task_id_t;
|
||||
#define ompt_task_id_none ((ompt_task_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_parallel_id_t;
|
||||
#define ompt_parallel_id_none ((ompt_parallel_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_wait_id_t;
|
||||
#define ompt_wait_id_none ((ompt_wait_id_t) 0) /* non-standard */
|
||||
|
||||
|
||||
/*---------------------
|
||||
* ompt_frame_t
|
||||
*---------------------*/
|
||||
|
||||
typedef struct ompt_frame_s {
|
||||
void *exit_runtime_frame; /* next frame is user code */
|
||||
void *reenter_runtime_frame; /* previous frame is user code */
|
||||
} ompt_frame_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* dependences types
|
||||
*---------------------*/
|
||||
|
||||
typedef enum ompt_task_dependence_flag_e {
|
||||
// a two bit field for the dependence type
|
||||
ompt_task_dependence_type_out = 1,
|
||||
ompt_task_dependence_type_in = 2,
|
||||
ompt_task_dependence_type_inout = 3,
|
||||
} ompt_task_dependence_flag_t;
|
||||
|
||||
typedef struct ompt_task_dependence_s {
|
||||
void *variable_addr;
|
||||
uint32_t dependence_flags;
|
||||
} ompt_task_dependence_t;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* enumerations for thread states and runtime events
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* runtime states
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_state_macro(state, code) state = code,
|
||||
FOREACH_OMPT_STATE(ompt_state_macro)
|
||||
#undef ompt_state_macro
|
||||
} ompt_state_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* runtime events
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_event_macro(event, callback, eventid) event = eventid,
|
||||
FOREACH_OMPT_EVENT(ompt_event_macro)
|
||||
#undef ompt_event_macro
|
||||
} ompt_event_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* set callback results
|
||||
*---------------------*/
|
||||
typedef enum {
|
||||
ompt_set_result_registration_error = 0,
|
||||
ompt_set_result_event_may_occur_no_callback = 1,
|
||||
ompt_set_result_event_never_occurs = 2,
|
||||
ompt_set_result_event_may_occur_callback_some = 3,
|
||||
ompt_set_result_event_may_occur_callback_always = 4,
|
||||
} ompt_set_result_t;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* callback signatures
|
||||
*****************************************************************************/
|
||||
|
||||
/* initialization */
|
||||
typedef void (*ompt_interface_fn_t)(void);
|
||||
|
||||
typedef ompt_interface_fn_t (*ompt_function_lookup_t)(
|
||||
const char * /* entry point to look up */
|
||||
);
|
||||
|
||||
/* threads */
|
||||
typedef void (*ompt_thread_callback_t) (
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
ompt_thread_initial = 1, // start the enumeration at 1
|
||||
ompt_thread_worker = 2,
|
||||
ompt_thread_other = 3
|
||||
} ompt_thread_type_t;
|
||||
|
||||
typedef enum {
|
||||
ompt_invoker_program = 0, /* program invokes master task */
|
||||
ompt_invoker_runtime = 1 /* runtime invokes master task */
|
||||
} ompt_invoker_t;
|
||||
|
||||
typedef void (*ompt_thread_type_callback_t) (
|
||||
ompt_thread_type_t thread_type, /* type of thread */
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef void (*ompt_wait_callback_t) (
|
||||
ompt_wait_id_t wait_id /* wait id */
|
||||
);
|
||||
|
||||
/* parallel and workshares */
|
||||
typedef void (*ompt_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_workshare_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
void *workshare_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_parallel_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data of parent task */
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
uint32_t requested_team_size, /* number of threads in team */
|
||||
void *parallel_function, /* pointer to outlined function */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
typedef void (*ompt_end_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id, /* id of task */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
/* tasks */
|
||||
typedef void (*ompt_task_callback_t) (
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_task_pair_callback_t) (
|
||||
ompt_task_id_t first_task_id,
|
||||
ompt_task_id_t second_task_id
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_task_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data for parent task */
|
||||
ompt_task_id_t new_task_id, /* id of created task */
|
||||
void *task_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
/* task dependences */
|
||||
typedef void (*ompt_task_dependences_callback_t) (
|
||||
ompt_task_id_t task_id, /* ID of task with dependences */
|
||||
const ompt_task_dependence_t *deps,/* vector of task dependences */
|
||||
int ndeps /* number of dependences */
|
||||
);
|
||||
|
||||
/* program */
|
||||
typedef void (*ompt_control_callback_t) (
|
||||
uint64_t command, /* command of control call */
|
||||
uint64_t modifier /* modifier of control call */
|
||||
);
|
||||
|
||||
typedef void (*ompt_callback_t)(void);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* ompt API
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OMPT_API_FNTYPE(fn) fn##_t
|
||||
|
||||
#define OMPT_API_FUNCTION(return_type, fn, args) \
|
||||
typedef return_type (*OMPT_API_FNTYPE(fn)) args
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INQUIRY FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* state */
|
||||
OMPT_API_FUNCTION(ompt_state_t, ompt_get_state, (
|
||||
ompt_wait_id_t *ompt_wait_id
|
||||
));
|
||||
|
||||
/* thread */
|
||||
OMPT_API_FUNCTION(ompt_thread_id_t, ompt_get_thread_id, (void));
|
||||
|
||||
OMPT_API_FUNCTION(void *, ompt_get_idle_frame, (void));
|
||||
|
||||
/* parallel region */
|
||||
OMPT_API_FUNCTION(ompt_parallel_id_t, ompt_get_parallel_id, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_parallel_team_size, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
/* task */
|
||||
OMPT_API_FUNCTION(ompt_task_id_t, ompt_get_task_id, (
|
||||
int depth
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(ompt_frame_t *, ompt_get_task_frame, (
|
||||
int depth
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PLACEHOLDERS FOR PERFORMANCE REPORTING
|
||||
***************************************************************************/
|
||||
|
||||
/* idle */
|
||||
OMPT_API_FUNCTION(void, ompt_idle, (
|
||||
void
|
||||
));
|
||||
|
||||
/* overhead */
|
||||
OMPT_API_FUNCTION(void, ompt_overhead, (
|
||||
void
|
||||
));
|
||||
|
||||
/* barrier wait */
|
||||
OMPT_API_FUNCTION(void, ompt_barrier_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* task wait */
|
||||
OMPT_API_FUNCTION(void, ompt_task_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* mutex wait */
|
||||
OMPT_API_FUNCTION(void, ompt_mutex_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INITIALIZATION FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
OMPT_API_FUNCTION(void, ompt_initialize, (
|
||||
ompt_function_lookup_t ompt_fn_lookup,
|
||||
const char *runtime_version,
|
||||
unsigned int ompt_version
|
||||
));
|
||||
|
||||
|
||||
/* initialization interface to be defined by tool */
|
||||
ompt_initialize_t ompt_tool(void);
|
||||
|
||||
typedef enum opt_init_mode_e {
|
||||
ompt_init_mode_never = 0,
|
||||
ompt_init_mode_false = 1,
|
||||
ompt_init_mode_true = 2,
|
||||
ompt_init_mode_always = 3
|
||||
} ompt_init_mode_t;
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_set_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t callback
|
||||
));
|
||||
|
||||
typedef enum ompt_set_callback_rc_e { /* non-standard */
|
||||
ompt_set_callback_error = 0,
|
||||
ompt_has_event_no_callback = 1,
|
||||
ompt_no_event_no_callback = 2,
|
||||
ompt_has_event_may_callback = 3,
|
||||
ompt_has_event_must_callback = 4,
|
||||
} ompt_set_callback_rc_t;
|
||||
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t *callback
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* MISCELLANEOUS FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* control */
|
||||
// FIXME: remove workaround for clang
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp declare target
|
||||
#endif
|
||||
void ompt_control(
|
||||
uint64_t command,
|
||||
uint64_t modifier
|
||||
);
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp end declare target
|
||||
#endif
|
||||
|
||||
/* state enumeration */
|
||||
OMPT_API_FUNCTION(int, ompt_enumerate_state, (
|
||||
int current_state,
|
||||
int *next_state,
|
||||
const char **next_state_name
|
||||
));
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* include/45/omp.h.var
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
|
||||
# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
|
||||
# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
/* schedule kind constants */
|
||||
typedef enum omp_sched_t {
|
||||
omp_sched_static = 1,
|
||||
omp_sched_dynamic = 2,
|
||||
omp_sched_guided = 3,
|
||||
omp_sched_auto = 4
|
||||
} omp_sched_t;
|
||||
|
||||
/* set API functions */
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_max_active_levels (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_schedule (omp_sched_t, int);
|
||||
|
||||
/* query API functions */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_final (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_team_size (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_limit (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_active_levels (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_schedule (omp_sched_t *, int *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_task_priority (void);
|
||||
|
||||
/* lock API functions */
|
||||
typedef struct omp_lock_t {
|
||||
void * _lk;
|
||||
} omp_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
|
||||
|
||||
/* nested lock API functions */
|
||||
typedef struct omp_nest_lock_t {
|
||||
void * _lk;
|
||||
} omp_nest_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
|
||||
|
||||
/* lock hint type for dynamic user lock */
|
||||
typedef enum omp_lock_hint_t {
|
||||
omp_lock_hint_none = 0,
|
||||
omp_lock_hint_uncontended = 1,
|
||||
omp_lock_hint_contended = (1<<1 ),
|
||||
omp_lock_hint_nonspeculative = (1<<2 ),
|
||||
omp_lock_hint_speculative = (1<<3 ),
|
||||
kmp_lock_hint_hle = (1<<16),
|
||||
kmp_lock_hint_rtm = (1<<17),
|
||||
kmp_lock_hint_adaptive = (1<<18)
|
||||
} omp_lock_hint_t;
|
||||
|
||||
/* hinted lock initializers */
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t);
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_nest_lock_with_hint(omp_nest_lock_t *, omp_lock_hint_t);
|
||||
|
||||
/* time API functions */
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
|
||||
|
||||
/* OpenMP 4.0 */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_default_device (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_default_device (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_is_initial_device (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_devices (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_teams (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void);
|
||||
|
||||
# include <stdlib.h>
|
||||
/* OpenMP 4.5 */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void);
|
||||
extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_target_free(void *, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_is_present(void *, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
|
||||
const size_t *, const size_t *, const size_t *, const size_t *, int, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(void *, int);
|
||||
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_disp_num_buffers (int);
|
||||
|
||||
/* Intel affinity API */
|
||||
typedef void * kmp_affinity_mask_t;
|
||||
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
|
||||
/* OpenMP 4.0 affinity API */
|
||||
typedef enum omp_proc_bind_t {
|
||||
omp_proc_bind_false = 0,
|
||||
omp_proc_bind_true = 1,
|
||||
omp_proc_bind_master = 2,
|
||||
omp_proc_bind_close = 3,
|
||||
omp_proc_bind_spread = 4
|
||||
} omp_proc_bind_t;
|
||||
|
||||
extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
|
||||
|
||||
/* OpenMP 4.5 affinity API */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_places (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_place_num_procs (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_place_proc_ids (int, int *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_place_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_partition_num_places (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_partition_place_nums (int *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __OMP_H */
|
||||
|
||||
@@ -0,0 +1,855 @@
|
||||
! include/45/omp_lib.f.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!dec$ fixedformlinesize:132
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
integer, parameter :: omp_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_cancel_kind = omp_integer_kind
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) level
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) level
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime()
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick ()
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_get_cancellation()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
function omp_is_initial_device()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial()
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround()
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput()
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string)
|
||||
character*(*) string
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s()
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
integer (kind=kmp_size_t_kind) alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind) nelem
|
||||
integer (kind=kmp_size_t_kind) elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on()
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off()
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
function kmp_get_cancellation_status(cancelkind)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_cancel_kind) cancelkind
|
||||
logical (kind=omp_logical_kind) kmp_get_cancellation_status
|
||||
end function kmp_get_cancellation_status
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind) hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind) hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
!dec$ if defined(_WIN32)
|
||||
!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
|
||||
|
||||
!***
|
||||
!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
|
||||
!*** option is specified. The alias attribute ensures that the specified
|
||||
!*** string is used as the entry point.
|
||||
!***
|
||||
!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended. On the Windows* OS Intel(R) 64
|
||||
!*** architecture, no underscore is prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
|
||||
!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
|
||||
!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
|
||||
!dec$ attributes alias:'OMP_GET_LEVEL' :: omp_get_level
|
||||
!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
|
||||
!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_TEAM_SIZE' :: omp_get_team_size
|
||||
!dec$ attributes alias:'OMP_SET_SCHEDULE' :: omp_set_schedule
|
||||
!dec$ attributes alias:'OMP_GET_SCHEDULE' :: omp_get_schedule
|
||||
!dec$ attributes alias:'OMP_GET_PROC_BIND' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
|
||||
!dec$ attributes alias:'OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
|
||||
!dec$ attributes alias:'OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
|
||||
!dec$ attributes alias:'OMP_GET_NUM_DEVICES' :: omp_get_num_devices
|
||||
!dec$ attributes alias:'OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
!dec$ attributes alias:'OMP_GET_MAX_TASK_PRIORITY' :: omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'omp_init_lock_with_hint' :: omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
|
||||
|
||||
!dec$ else
|
||||
|
||||
!***
|
||||
!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
|
||||
!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
|
||||
!dec$ attributes alias:'_OMP_GET_LEVEL' :: omp_get_level
|
||||
!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
|
||||
!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_TEAM_SIZE' :: omp_get_team_size
|
||||
!dec$ attributes alias:'_OMP_SET_SCHEDULE' :: omp_set_schedule
|
||||
!dec$ attributes alias:'_OMP_GET_SCHEDULE' :: omp_get_schedule
|
||||
!dec$ attributes alias:'_OMP_GET_PROC_BIND' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
|
||||
!dec$ attributes alias:'_OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
|
||||
!dec$ attributes alias:'_OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_DEVICES' :: omp_get_num_devices
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'_OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'_OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'_OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_TASK_PRIORTY' :: omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'_omp_init_lock_with_hint' :: omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'_KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__linux)
|
||||
|
||||
!***
|
||||
!*** The Linux* OS entry points are in lowercase, with an underscore appended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
|
||||
!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
|
||||
!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
|
||||
!dec$ attributes alias:'omp_get_level_'::omp_get_level
|
||||
!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
|
||||
!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
|
||||
!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
|
||||
!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
|
||||
!dec$ attributes alias:'omp_get_proc_bind_' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
|
||||
!dec$ attributes alias:'omp_get_default_device_'::omp_get_default_device
|
||||
!dec$ attributes alias:'omp_set_default_device_'::omp_set_default_device
|
||||
!dec$ attributes alias:'omp_get_num_devices_'::omp_get_num_devices
|
||||
!dec$ attributes alias:'omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'omp_is_initial_device_'::omp_is_initial_device
|
||||
!dec$ attributes alias:'omp_get_max_task_priority_'::omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_init_lock_with_hint_'::omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
|
||||
!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
|
||||
!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
!dec$ attributes alias:'kmp_get_cancellation_status_'::kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__APPLE__)
|
||||
|
||||
!***
|
||||
!*** The Mac entry points are in lowercase, with an both an underscore
|
||||
!*** appended and an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
|
||||
!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
|
||||
!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
|
||||
!dec$ attributes alias:'_omp_get_level_'::omp_get_level
|
||||
!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
|
||||
!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
|
||||
!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
|
||||
!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
|
||||
!dec$ attributes alias:'_omp_get_proc_bind_' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
|
||||
!dec$ attributes alias:'_omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'_omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'_omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'_omp_is_initial_device_'::omp_is_initial_device
|
||||
!dec$ attributes alias:'_omp_get_max_task_priorty_'::omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_init_lock_with_hint_'::omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
|
||||
!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
|
||||
!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'_kmp_get_cancellation_status_'::kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
|
||||
end module omp_lib
|
||||
|
||||
@@ -0,0 +1,524 @@
|
||||
! include/45/omp_lib.f90.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
|
||||
integer, parameter :: omp_integer_kind = c_int
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = c_float
|
||||
integer, parameter :: kmp_double_kind = c_double
|
||||
integer, parameter :: omp_lock_kind = c_intptr_t
|
||||
integer, parameter :: omp_nest_lock_kind = c_intptr_t
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = c_intptr_t
|
||||
integer, parameter :: kmp_size_t_kind = c_size_t
|
||||
integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
|
||||
integer, parameter :: kmp_cancel_kind = omp_integer_kind
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_get_cancellation() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
function omp_is_initial_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial() bind(c)
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround() bind(c)
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput() bind(c)
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string) bind(c)
|
||||
use, intrinsic :: iso_c_binding
|
||||
character (kind=c_char) :: string(*)
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind), value :: nelem
|
||||
integer (kind=kmp_size_t_kind), value :: elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on() bind(c)
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off() bind(c)
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
function kmp_get_cancellation_status(cancelkind) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_cancel_kind), value :: cancelkind
|
||||
logical (kind=omp_logical_kind) kmp_get_cancellation_status
|
||||
end function kmp_get_cancellation_status
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
end module omp_lib
|
||||
@@ -0,0 +1,644 @@
|
||||
! include/45/omp_lib.h.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!DIR$ fixedformlinesize:132
|
||||
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
integer, parameter :: omp_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
import
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime() bind(c)
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick() bind(c)
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_is_initial_device() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial() bind(c)
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround() bind(c)
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput() bind(c)
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string) bind(c)
|
||||
character string(*)
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s() bind(c)
|
||||
import
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask) bind(c)
|
||||
import
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask) bind(c)
|
||||
import
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind), value :: nelem
|
||||
integer (kind=kmp_size_t_kind), value :: elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on() bind(c)
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off() bind(c)
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint) bind(c)
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
!DIR$ IF DEFINED (__INTEL_OFFLOAD)
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_num_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_dynamic
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nested
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_procs
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_parallel
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_final
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_dynamic
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_nested
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_limit
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_max_active_levels
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_active_levels
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_level
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_active_level
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_ancestor_thread_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_size
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_schedule
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_schedule
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_proc_bind
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtick
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_is_initial_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_task_priority
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize_s
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_blocktime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_serial
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_turnaround
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_throughput
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_defaults
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize_s
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_blocktime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_library
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_disp_num_buffers
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_max_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_create_affinity_mask
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_destroy_affinity_mask
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_unset_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_aligned_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_calloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_realloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_free
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_on
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_off
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock_with_hint
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock_with_hint
|
||||
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!$omp declare target(omp_set_num_threads )
|
||||
!$omp declare target(omp_set_dynamic )
|
||||
!$omp declare target(omp_set_nested )
|
||||
!$omp declare target(omp_get_num_threads )
|
||||
!$omp declare target(omp_get_max_threads )
|
||||
!$omp declare target(omp_get_thread_num )
|
||||
!$omp declare target(omp_get_num_procs )
|
||||
!$omp declare target(omp_in_parallel )
|
||||
!$omp declare target(omp_in_final )
|
||||
!$omp declare target(omp_get_dynamic )
|
||||
!$omp declare target(omp_get_nested )
|
||||
!$omp declare target(omp_get_thread_limit )
|
||||
!$omp declare target(omp_set_max_active_levels )
|
||||
!$omp declare target(omp_get_max_active_levels )
|
||||
!$omp declare target(omp_get_level )
|
||||
!$omp declare target(omp_get_active_level )
|
||||
!$omp declare target(omp_get_ancestor_thread_num )
|
||||
!$omp declare target(omp_get_team_size )
|
||||
!$omp declare target(omp_set_schedule )
|
||||
!$omp declare target(omp_get_schedule )
|
||||
!$omp declare target(omp_get_proc_bind )
|
||||
!$omp declare target(omp_get_wtime )
|
||||
!$omp declare target(omp_get_wtick )
|
||||
!$omp declare target(omp_get_default_device )
|
||||
!$omp declare target(omp_set_default_device )
|
||||
!$omp declare target(omp_is_initial_device )
|
||||
!$omp declare target(omp_get_num_devices )
|
||||
!$omp declare target(omp_get_num_teams )
|
||||
!$omp declare target(omp_get_team_num )
|
||||
!$omp declare target(omp_init_lock )
|
||||
!$omp declare target(omp_destroy_lock )
|
||||
!$omp declare target(omp_set_lock )
|
||||
!$omp declare target(omp_unset_lock )
|
||||
!$omp declare target(omp_test_lock )
|
||||
!$omp declare target(omp_init_nest_lock )
|
||||
!$omp declare target(omp_destroy_nest_lock )
|
||||
!$omp declare target(omp_set_nest_lock )
|
||||
!$omp declare target(omp_unset_nest_lock )
|
||||
!$omp declare target(omp_test_nest_lock )
|
||||
!$omp declare target(omp_get_max_task_priority )
|
||||
!$omp declare target(kmp_set_stacksize )
|
||||
!$omp declare target(kmp_set_stacksize_s )
|
||||
!$omp declare target(kmp_set_blocktime )
|
||||
!$omp declare target(kmp_set_library_serial )
|
||||
!$omp declare target(kmp_set_library_turnaround )
|
||||
!$omp declare target(kmp_set_library_throughput )
|
||||
!$omp declare target(kmp_set_library )
|
||||
!$omp declare target(kmp_set_defaults )
|
||||
!$omp declare target(kmp_get_stacksize )
|
||||
!$omp declare target(kmp_get_stacksize_s )
|
||||
!$omp declare target(kmp_get_blocktime )
|
||||
!$omp declare target(kmp_get_library )
|
||||
!$omp declare target(kmp_set_disp_num_buffers )
|
||||
!$omp declare target(kmp_set_affinity )
|
||||
!$omp declare target(kmp_get_affinity )
|
||||
!$omp declare target(kmp_get_affinity_max_proc )
|
||||
!$omp declare target(kmp_create_affinity_mask )
|
||||
!$omp declare target(kmp_destroy_affinity_mask )
|
||||
!$omp declare target(kmp_set_affinity_mask_proc )
|
||||
!$omp declare target(kmp_unset_affinity_mask_proc )
|
||||
!$omp declare target(kmp_get_affinity_mask_proc )
|
||||
!$omp declare target(kmp_malloc )
|
||||
!$omp declare target(kmp_aligned_malloc )
|
||||
!$omp declare target(kmp_calloc )
|
||||
!$omp declare target(kmp_realloc )
|
||||
!$omp declare target(kmp_free )
|
||||
!$omp declare target(kmp_set_warnings_on )
|
||||
!$omp declare target(kmp_set_warnings_off )
|
||||
!$omp declare target(omp_init_lock_with_hint )
|
||||
!$omp declare target(omp_init_nest_lock_with_hint )
|
||||
!DIR$ ENDIF
|
||||
!DIR$ ENDIF
|
||||
|
||||
@@ -0,0 +1,515 @@
|
||||
/*
|
||||
* include/45/ompt.h.var
|
||||
*/
|
||||
|
||||
#ifndef __OMPT__
|
||||
#define __OMPT__
|
||||
|
||||
/*****************************************************************************
|
||||
* system include files
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* iteration macros
|
||||
*****************************************************************************/
|
||||
|
||||
#define FOREACH_OMPT_INQUIRY_FN(macro) \
|
||||
macro (ompt_enumerate_state) \
|
||||
\
|
||||
macro (ompt_set_callback) \
|
||||
macro (ompt_get_callback) \
|
||||
\
|
||||
macro (ompt_get_idle_frame) \
|
||||
macro (ompt_get_task_frame) \
|
||||
\
|
||||
macro (ompt_get_state) \
|
||||
\
|
||||
macro (ompt_get_parallel_id) \
|
||||
macro (ompt_get_parallel_team_size) \
|
||||
macro (ompt_get_task_id) \
|
||||
macro (ompt_get_thread_id)
|
||||
|
||||
#define FOREACH_OMPT_PLACEHOLDER_FN(macro) \
|
||||
macro (ompt_idle) \
|
||||
macro (ompt_overhead) \
|
||||
macro (ompt_barrier_wait) \
|
||||
macro (ompt_task_wait) \
|
||||
macro (ompt_mutex_wait)
|
||||
|
||||
#define FOREACH_OMPT_STATE(macro) \
|
||||
\
|
||||
/* first */ \
|
||||
macro (ompt_state_first, 0x71) /* initial enumeration state */ \
|
||||
\
|
||||
/* work states (0..15) */ \
|
||||
macro (ompt_state_work_serial, 0x00) /* working outside parallel */ \
|
||||
macro (ompt_state_work_parallel, 0x01) /* working within parallel */ \
|
||||
macro (ompt_state_work_reduction, 0x02) /* performing a reduction */ \
|
||||
\
|
||||
/* idle (16..31) */ \
|
||||
macro (ompt_state_idle, 0x10) /* waiting for work */ \
|
||||
\
|
||||
/* overhead states (32..63) */ \
|
||||
macro (ompt_state_overhead, 0x20) /* overhead excluding wait states */ \
|
||||
\
|
||||
/* barrier wait states (64..79) */ \
|
||||
macro (ompt_state_wait_barrier, 0x40) /* waiting at a barrier */ \
|
||||
macro (ompt_state_wait_barrier_implicit, 0x41) /* implicit barrier */ \
|
||||
macro (ompt_state_wait_barrier_explicit, 0x42) /* explicit barrier */ \
|
||||
\
|
||||
/* task wait states (80..95) */ \
|
||||
macro (ompt_state_wait_taskwait, 0x50) /* waiting at a taskwait */ \
|
||||
macro (ompt_state_wait_taskgroup, 0x51) /* waiting at a taskgroup */ \
|
||||
\
|
||||
/* mutex wait states (96..111) */ \
|
||||
macro (ompt_state_wait_lock, 0x60) /* waiting for lock */ \
|
||||
macro (ompt_state_wait_nest_lock, 0x61) /* waiting for nest lock */ \
|
||||
macro (ompt_state_wait_critical, 0x62) /* waiting for critical */ \
|
||||
macro (ompt_state_wait_atomic, 0x63) /* waiting for atomic */ \
|
||||
macro (ompt_state_wait_ordered, 0x64) /* waiting for ordered */ \
|
||||
macro (ompt_state_wait_single, 0x6F) /* waiting for single region (non-standard!) */ \
|
||||
\
|
||||
/* misc (112..127) */ \
|
||||
macro (ompt_state_undefined, 0x70) /* undefined thread state */
|
||||
|
||||
|
||||
#define FOREACH_OMPT_EVENT(macro) \
|
||||
\
|
||||
/*--- Mandatory Events ---*/ \
|
||||
macro (ompt_event_parallel_begin, ompt_new_parallel_callback_t, 1) /* parallel begin */ \
|
||||
macro (ompt_event_parallel_end, ompt_end_parallel_callback_t, 2) /* parallel end */ \
|
||||
\
|
||||
macro (ompt_event_task_begin, ompt_new_task_callback_t, 3) /* task begin */ \
|
||||
macro (ompt_event_task_end, ompt_task_callback_t, 4) /* task destroy */ \
|
||||
\
|
||||
macro (ompt_event_thread_begin, ompt_thread_type_callback_t, 5) /* thread begin */ \
|
||||
macro (ompt_event_thread_end, ompt_thread_type_callback_t, 6) /* thread end */ \
|
||||
\
|
||||
macro (ompt_event_control, ompt_control_callback_t, 7) /* support control calls */ \
|
||||
\
|
||||
macro (ompt_event_runtime_shutdown, ompt_callback_t, 8) /* runtime shutdown */ \
|
||||
\
|
||||
/*--- Optional Events (blame shifting, ompt_event_unimplemented) ---*/ \
|
||||
macro (ompt_event_idle_begin, ompt_thread_callback_t, 9) /* begin idle state */ \
|
||||
macro (ompt_event_idle_end, ompt_thread_callback_t, 10) /* end idle state */ \
|
||||
\
|
||||
macro (ompt_event_wait_barrier_begin, ompt_parallel_callback_t, 11) /* begin wait at barrier */ \
|
||||
macro (ompt_event_wait_barrier_end, ompt_parallel_callback_t, 12) /* end wait at barrier */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskwait_begin, ompt_parallel_callback_t, 13) /* begin wait at taskwait */ \
|
||||
macro (ompt_event_wait_taskwait_end, ompt_parallel_callback_t, 14) /* end wait at taskwait */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskgroup_begin, ompt_parallel_callback_t, 15) /* begin wait at taskgroup */\
|
||||
macro (ompt_event_wait_taskgroup_end, ompt_parallel_callback_t, 16) /* end wait at taskgroup */ \
|
||||
\
|
||||
macro (ompt_event_release_lock, ompt_wait_callback_t, 17) /* lock release */ \
|
||||
macro (ompt_event_release_nest_lock_last, ompt_wait_callback_t, 18) /* last nest lock release */ \
|
||||
macro (ompt_event_release_critical, ompt_wait_callback_t, 19) /* critical release */ \
|
||||
\
|
||||
macro (ompt_event_release_atomic, ompt_wait_callback_t, 20) /* atomic release */ \
|
||||
\
|
||||
macro (ompt_event_release_ordered, ompt_wait_callback_t, 21) /* ordered release */ \
|
||||
\
|
||||
/*--- Optional Events (synchronous events, ompt_event_unimplemented) --- */ \
|
||||
macro (ompt_event_implicit_task_begin, ompt_parallel_callback_t, 22) /* implicit task begin */ \
|
||||
macro (ompt_event_implicit_task_end, ompt_parallel_callback_t, 23) /* implicit task end */ \
|
||||
\
|
||||
macro (ompt_event_initial_task_begin, ompt_parallel_callback_t, 24) /* initial task begin */ \
|
||||
macro (ompt_event_initial_task_end, ompt_parallel_callback_t, 25) /* initial task end */ \
|
||||
\
|
||||
macro (ompt_event_task_switch, ompt_task_pair_callback_t, 26) /* task switch */ \
|
||||
\
|
||||
macro (ompt_event_loop_begin, ompt_new_workshare_callback_t, 27) /* task at loop begin */ \
|
||||
macro (ompt_event_loop_end, ompt_parallel_callback_t, 28) /* task at loop end */ \
|
||||
\
|
||||
macro (ompt_event_sections_begin, ompt_new_workshare_callback_t, 29) /* task at sections begin */\
|
||||
macro (ompt_event_sections_end, ompt_parallel_callback_t, 30) /* task at sections end */ \
|
||||
\
|
||||
macro (ompt_event_single_in_block_begin, ompt_new_workshare_callback_t, 31) /* task at single begin*/ \
|
||||
macro (ompt_event_single_in_block_end, ompt_parallel_callback_t, 32) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_single_others_begin, ompt_parallel_callback_t, 33) /* task at single begin */ \
|
||||
macro (ompt_event_single_others_end, ompt_parallel_callback_t, 34) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_workshare_begin, ompt_new_workshare_callback_t, 35) /* task at workshare begin */\
|
||||
macro (ompt_event_workshare_end, ompt_parallel_callback_t, 36) /* task at workshare end */ \
|
||||
\
|
||||
macro (ompt_event_master_begin, ompt_parallel_callback_t, 37) /* task at master begin */ \
|
||||
macro (ompt_event_master_end, ompt_parallel_callback_t, 38) /* task at master end */ \
|
||||
\
|
||||
macro (ompt_event_barrier_begin, ompt_parallel_callback_t, 39) /* task at barrier begin */ \
|
||||
macro (ompt_event_barrier_end, ompt_parallel_callback_t, 40) /* task at barrier end */ \
|
||||
\
|
||||
macro (ompt_event_taskwait_begin, ompt_parallel_callback_t, 41) /* task at taskwait begin */ \
|
||||
macro (ompt_event_taskwait_end, ompt_parallel_callback_t, 42) /* task at task wait end */ \
|
||||
\
|
||||
macro (ompt_event_taskgroup_begin, ompt_parallel_callback_t, 43) /* task at taskgroup begin */\
|
||||
macro (ompt_event_taskgroup_end, ompt_parallel_callback_t, 44) /* task at taskgroup end */ \
|
||||
\
|
||||
macro (ompt_event_release_nest_lock_prev, ompt_wait_callback_t, 45) /* prev nest lock release */ \
|
||||
\
|
||||
macro (ompt_event_wait_lock, ompt_wait_callback_t, 46) /* lock wait */ \
|
||||
macro (ompt_event_wait_nest_lock, ompt_wait_callback_t, 47) /* nest lock wait */ \
|
||||
macro (ompt_event_wait_critical, ompt_wait_callback_t, 48) /* critical wait */ \
|
||||
macro (ompt_event_wait_atomic, ompt_wait_callback_t, 49) /* atomic wait */ \
|
||||
macro (ompt_event_wait_ordered, ompt_wait_callback_t, 50) /* ordered wait */ \
|
||||
\
|
||||
macro (ompt_event_acquired_lock, ompt_wait_callback_t, 51) /* lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_first, ompt_wait_callback_t, 52) /* 1st nest lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_next, ompt_wait_callback_t, 53) /* next nest lock acquired*/ \
|
||||
macro (ompt_event_acquired_critical, ompt_wait_callback_t, 54) /* critical acquired */ \
|
||||
macro (ompt_event_acquired_atomic, ompt_wait_callback_t, 55) /* atomic acquired */ \
|
||||
macro (ompt_event_acquired_ordered, ompt_wait_callback_t, 56) /* ordered acquired */ \
|
||||
\
|
||||
macro (ompt_event_init_lock, ompt_wait_callback_t, 57) /* lock init */ \
|
||||
macro (ompt_event_init_nest_lock, ompt_wait_callback_t, 58) /* nest lock init */ \
|
||||
\
|
||||
macro (ompt_event_destroy_lock, ompt_wait_callback_t, 59) /* lock destruction */ \
|
||||
macro (ompt_event_destroy_nest_lock, ompt_wait_callback_t, 60) /* nest lock destruction */ \
|
||||
\
|
||||
macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */ \
|
||||
\
|
||||
macro (ompt_event_task_dependences, ompt_task_dependences_callback_t, 69) /* report task dependences */\
|
||||
macro (ompt_event_task_dependence_pair, ompt_task_pair_callback_t, 70) /* report task dependence pair */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* data types
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* identifiers
|
||||
*---------------------*/
|
||||
|
||||
typedef uint64_t ompt_thread_id_t;
|
||||
#define ompt_thread_id_none ((ompt_thread_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_task_id_t;
|
||||
#define ompt_task_id_none ((ompt_task_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_parallel_id_t;
|
||||
#define ompt_parallel_id_none ((ompt_parallel_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_wait_id_t;
|
||||
#define ompt_wait_id_none ((ompt_wait_id_t) 0) /* non-standard */
|
||||
|
||||
|
||||
/*---------------------
|
||||
* ompt_frame_t
|
||||
*---------------------*/
|
||||
|
||||
typedef struct ompt_frame_s {
|
||||
void *exit_runtime_frame; /* next frame is user code */
|
||||
void *reenter_runtime_frame; /* previous frame is user code */
|
||||
} ompt_frame_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* dependences types
|
||||
*---------------------*/
|
||||
|
||||
typedef enum ompt_task_dependence_flag_e {
|
||||
// a two bit field for the dependence type
|
||||
ompt_task_dependence_type_out = 1,
|
||||
ompt_task_dependence_type_in = 2,
|
||||
ompt_task_dependence_type_inout = 3,
|
||||
} ompt_task_dependence_flag_t;
|
||||
|
||||
typedef struct ompt_task_dependence_s {
|
||||
void *variable_addr;
|
||||
uint32_t dependence_flags;
|
||||
} ompt_task_dependence_t;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* enumerations for thread states and runtime events
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* runtime states
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_state_macro(state, code) state = code,
|
||||
FOREACH_OMPT_STATE(ompt_state_macro)
|
||||
#undef ompt_state_macro
|
||||
} ompt_state_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* runtime events
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_event_macro(event, callback, eventid) event = eventid,
|
||||
FOREACH_OMPT_EVENT(ompt_event_macro)
|
||||
#undef ompt_event_macro
|
||||
} ompt_event_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* set callback results
|
||||
*---------------------*/
|
||||
typedef enum {
|
||||
ompt_set_result_registration_error = 0,
|
||||
ompt_set_result_event_may_occur_no_callback = 1,
|
||||
ompt_set_result_event_never_occurs = 2,
|
||||
ompt_set_result_event_may_occur_callback_some = 3,
|
||||
ompt_set_result_event_may_occur_callback_always = 4,
|
||||
} ompt_set_result_t;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* callback signatures
|
||||
*****************************************************************************/
|
||||
|
||||
/* initialization */
|
||||
typedef void (*ompt_interface_fn_t)(void);
|
||||
|
||||
typedef ompt_interface_fn_t (*ompt_function_lookup_t)(
|
||||
const char * /* entry point to look up */
|
||||
);
|
||||
|
||||
/* threads */
|
||||
typedef void (*ompt_thread_callback_t) (
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
ompt_thread_initial = 1, // start the enumeration at 1
|
||||
ompt_thread_worker = 2,
|
||||
ompt_thread_other = 3
|
||||
} ompt_thread_type_t;
|
||||
|
||||
typedef enum {
|
||||
ompt_invoker_program = 0, /* program invokes master task */
|
||||
ompt_invoker_runtime = 1 /* runtime invokes master task */
|
||||
} ompt_invoker_t;
|
||||
|
||||
typedef void (*ompt_thread_type_callback_t) (
|
||||
ompt_thread_type_t thread_type, /* type of thread */
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef void (*ompt_wait_callback_t) (
|
||||
ompt_wait_id_t wait_id /* wait id */
|
||||
);
|
||||
|
||||
/* parallel and workshares */
|
||||
typedef void (*ompt_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_workshare_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
void *workshare_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_parallel_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data of parent task */
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
uint32_t requested_team_size, /* number of threads in team */
|
||||
void *parallel_function, /* pointer to outlined function */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
typedef void (*ompt_end_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id, /* id of task */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
/* tasks */
|
||||
typedef void (*ompt_task_callback_t) (
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_task_pair_callback_t) (
|
||||
ompt_task_id_t first_task_id,
|
||||
ompt_task_id_t second_task_id
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_task_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data for parent task */
|
||||
ompt_task_id_t new_task_id, /* id of created task */
|
||||
void *task_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
/* task dependences */
|
||||
typedef void (*ompt_task_dependences_callback_t) (
|
||||
ompt_task_id_t task_id, /* ID of task with dependences */
|
||||
const ompt_task_dependence_t *deps,/* vector of task dependences */
|
||||
int ndeps /* number of dependences */
|
||||
);
|
||||
|
||||
/* program */
|
||||
typedef void (*ompt_control_callback_t) (
|
||||
uint64_t command, /* command of control call */
|
||||
uint64_t modifier /* modifier of control call */
|
||||
);
|
||||
|
||||
typedef void (*ompt_callback_t)(void);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* ompt API
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OMPT_API_FNTYPE(fn) fn##_t
|
||||
|
||||
#define OMPT_API_FUNCTION(return_type, fn, args) \
|
||||
typedef return_type (*OMPT_API_FNTYPE(fn)) args
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INQUIRY FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* state */
|
||||
OMPT_API_FUNCTION(ompt_state_t, ompt_get_state, (
|
||||
ompt_wait_id_t *ompt_wait_id
|
||||
));
|
||||
|
||||
/* thread */
|
||||
OMPT_API_FUNCTION(ompt_thread_id_t, ompt_get_thread_id, (void));
|
||||
|
||||
OMPT_API_FUNCTION(void *, ompt_get_idle_frame, (void));
|
||||
|
||||
/* parallel region */
|
||||
OMPT_API_FUNCTION(ompt_parallel_id_t, ompt_get_parallel_id, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_parallel_team_size, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
/* task */
|
||||
OMPT_API_FUNCTION(ompt_task_id_t, ompt_get_task_id, (
|
||||
int depth
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(ompt_frame_t *, ompt_get_task_frame, (
|
||||
int depth
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PLACEHOLDERS FOR PERFORMANCE REPORTING
|
||||
***************************************************************************/
|
||||
|
||||
/* idle */
|
||||
OMPT_API_FUNCTION(void, ompt_idle, (
|
||||
void
|
||||
));
|
||||
|
||||
/* overhead */
|
||||
OMPT_API_FUNCTION(void, ompt_overhead, (
|
||||
void
|
||||
));
|
||||
|
||||
/* barrier wait */
|
||||
OMPT_API_FUNCTION(void, ompt_barrier_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* task wait */
|
||||
OMPT_API_FUNCTION(void, ompt_task_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* mutex wait */
|
||||
OMPT_API_FUNCTION(void, ompt_mutex_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INITIALIZATION FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
OMPT_API_FUNCTION(void, ompt_initialize, (
|
||||
ompt_function_lookup_t ompt_fn_lookup,
|
||||
const char *runtime_version,
|
||||
unsigned int ompt_version
|
||||
));
|
||||
|
||||
|
||||
/* initialization interface to be defined by tool */
|
||||
ompt_initialize_t ompt_tool(void);
|
||||
|
||||
typedef enum opt_init_mode_e {
|
||||
ompt_init_mode_never = 0,
|
||||
ompt_init_mode_false = 1,
|
||||
ompt_init_mode_true = 2,
|
||||
ompt_init_mode_always = 3
|
||||
} ompt_init_mode_t;
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_set_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t callback
|
||||
));
|
||||
|
||||
typedef enum ompt_set_callback_rc_e { /* non-standard */
|
||||
ompt_set_callback_error = 0,
|
||||
ompt_has_event_no_callback = 1,
|
||||
ompt_no_event_no_callback = 2,
|
||||
ompt_has_event_may_callback = 3,
|
||||
ompt_has_event_must_callback = 4,
|
||||
} ompt_set_callback_rc_t;
|
||||
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t *callback
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* MISCELLANEOUS FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* control */
|
||||
// FIXME: remove workaround for clang
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp declare target
|
||||
#endif
|
||||
void ompt_control(
|
||||
uint64_t command,
|
||||
uint64_t modifier
|
||||
);
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp end declare target
|
||||
#endif
|
||||
|
||||
/* state enumeration */
|
||||
OMPT_API_FUNCTION(int, ompt_enumerate_state, (
|
||||
int current_state,
|
||||
int *next_state,
|
||||
const char **next_state_name
|
||||
));
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* include/50/omp.h.var
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef __OMP_H
|
||||
# define __OMP_H
|
||||
|
||||
# define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
# define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
|
||||
# define KMP_VERSION_BUILD @LIBOMP_VERSION_BUILD@
|
||||
# define KMP_BUILD_DATE "@LIBOMP_BUILD_DATE@"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define __KAI_KMPC_CONVENTION __cdecl
|
||||
# else
|
||||
# define __KAI_KMPC_CONVENTION
|
||||
# endif
|
||||
|
||||
/* schedule kind constants */
|
||||
typedef enum omp_sched_t {
|
||||
omp_sched_static = 1,
|
||||
omp_sched_dynamic = 2,
|
||||
omp_sched_guided = 3,
|
||||
omp_sched_auto = 4
|
||||
} omp_sched_t;
|
||||
|
||||
/* set API functions */
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_num_threads (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_dynamic (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nested (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_max_active_levels (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_schedule (omp_sched_t, int);
|
||||
|
||||
/* query API functions */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_dynamic (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_nested (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_threads (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_procs (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_parallel (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_in_final (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_active_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_level (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_ancestor_thread_num (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_team_size (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_thread_limit (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_active_levels (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_schedule (omp_sched_t *, int *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_max_task_priority (void);
|
||||
|
||||
/* lock API functions */
|
||||
typedef struct omp_lock_t {
|
||||
void * _lk;
|
||||
} omp_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_lock (omp_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_lock (omp_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_lock (omp_lock_t *);
|
||||
|
||||
/* nested lock API functions */
|
||||
typedef struct omp_nest_lock_t {
|
||||
void * _lk;
|
||||
} omp_nest_lock_t;
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_unset_nest_lock (omp_nest_lock_t *);
|
||||
extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *);
|
||||
|
||||
/* lock hint type for dynamic user lock */
|
||||
typedef enum omp_lock_hint_t {
|
||||
omp_lock_hint_none = 0,
|
||||
omp_lock_hint_uncontended = 1,
|
||||
omp_lock_hint_contended = (1<<1 ),
|
||||
omp_lock_hint_nonspeculative = (1<<2 ),
|
||||
omp_lock_hint_speculative = (1<<3 ),
|
||||
kmp_lock_hint_hle = (1<<16),
|
||||
kmp_lock_hint_rtm = (1<<17),
|
||||
kmp_lock_hint_adaptive = (1<<18)
|
||||
} omp_lock_hint_t;
|
||||
|
||||
/* hinted lock initializers */
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t);
|
||||
extern void __KAI_KMPC_CONVENTION omp_init_nest_lock_with_hint(omp_nest_lock_t *, omp_lock_hint_t);
|
||||
|
||||
/* time API functions */
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtime (void);
|
||||
extern double __KAI_KMPC_CONVENTION omp_get_wtick (void);
|
||||
|
||||
/* OpenMP 4.0 */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_default_device (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_set_default_device (int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_is_initial_device (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_devices (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_teams (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_team_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void);
|
||||
|
||||
# include <stdlib.h>
|
||||
/* OpenMP 4.5 */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void);
|
||||
extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_target_free(void *, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_is_present(void *, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_memcpy(void *, void *, size_t, size_t, size_t, int, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_memcpy_rect(void *, void *, size_t, int, const size_t *,
|
||||
const size_t *, const size_t *, const size_t *, const size_t *, int, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_associate_ptr(void *, void *, size_t, size_t, int);
|
||||
extern int __KAI_KMPC_CONVENTION omp_target_disassociate_ptr(void *, int);
|
||||
|
||||
/* kmp API functions */
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
|
||||
extern size_t __KAI_KMPC_CONVENTION kmp_get_stacksize_s (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize_s (size_t);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_blocktime (void);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_library (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_blocktime (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library (int);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_serial (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_turnaround (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_library_throughput (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_defaults (char const *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_disp_num_buffers (int);
|
||||
|
||||
/* Intel affinity API */
|
||||
typedef void * kmp_affinity_mask_t;
|
||||
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_max_proc (void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_create_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_destroy_affinity_mask (kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_set_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_unset_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
extern int __KAI_KMPC_CONVENTION kmp_get_affinity_mask_proc (int, kmp_affinity_mask_t *);
|
||||
|
||||
/* OpenMP 4.0 affinity API */
|
||||
typedef enum omp_proc_bind_t {
|
||||
omp_proc_bind_false = 0,
|
||||
omp_proc_bind_true = 1,
|
||||
omp_proc_bind_master = 2,
|
||||
omp_proc_bind_close = 3,
|
||||
omp_proc_bind_spread = 4
|
||||
} omp_proc_bind_t;
|
||||
|
||||
extern omp_proc_bind_t __KAI_KMPC_CONVENTION omp_get_proc_bind (void);
|
||||
|
||||
/* OpenMP 4.5 affinity API */
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_num_places (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_place_num_procs (int);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_place_proc_ids (int, int *);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_place_num (void);
|
||||
extern int __KAI_KMPC_CONVENTION omp_get_partition_num_places (void);
|
||||
extern void __KAI_KMPC_CONVENTION omp_get_partition_place_nums (int *);
|
||||
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_malloc (size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_aligned_malloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_calloc (size_t, size_t);
|
||||
extern void * __KAI_KMPC_CONVENTION kmp_realloc (void *, size_t);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_free (void *);
|
||||
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_on(void);
|
||||
extern void __KAI_KMPC_CONVENTION kmp_set_warnings_off(void);
|
||||
|
||||
# undef __KAI_KMPC_CONVENTION
|
||||
|
||||
/* Warning:
|
||||
The following typedefs are not standard, deprecated and will be removed in a future release.
|
||||
*/
|
||||
typedef int omp_int_t;
|
||||
typedef double omp_wtime_t;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* __OMP_H */
|
||||
|
||||
@@ -0,0 +1,855 @@
|
||||
! include/50/omp_lib.f.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!dec$ fixedformlinesize:132
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
integer, parameter :: omp_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_cancel_kind = omp_integer_kind
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*), parameter :: kmp_build_date = '@LIBOMP_BUILD_DATE@'
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) level
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) level
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime()
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick ()
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_get_cancellation()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
function omp_is_initial_device()
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial()
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround()
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput()
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string)
|
||||
character*(*) string
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s()
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc()
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind) proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
integer (kind=kmp_size_t_kind) alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind) nelem
|
||||
integer (kind=kmp_size_t_kind) elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
integer (kind=kmp_size_t_kind) size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on()
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off()
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
function kmp_get_cancellation_status(cancelkind)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_cancel_kind) cancelkind
|
||||
logical (kind=omp_logical_kind) kmp_get_cancellation_status
|
||||
end function kmp_get_cancellation_status
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind) hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind) hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
!dec$ if defined(_WIN32)
|
||||
!dec$ if defined(_WIN64) .or. defined(_M_AMD64)
|
||||
|
||||
!***
|
||||
!*** The Fortran entry points must be in uppercase, even if the /Qlowercase
|
||||
!*** option is specified. The alias attribute ensures that the specified
|
||||
!*** string is used as the entry point.
|
||||
!***
|
||||
!*** On the Windows* OS IA-32 architecture, the Fortran entry points have an
|
||||
!*** underscore prepended. On the Windows* OS Intel(R) 64
|
||||
!*** architecture, no underscore is prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
|
||||
!dec$ attributes alias:'OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
|
||||
!dec$ attributes alias:'OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
|
||||
!dec$ attributes alias:'OMP_GET_LEVEL' :: omp_get_level
|
||||
!dec$ attributes alias:'OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
|
||||
!dec$ attributes alias:'OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'OMP_GET_TEAM_SIZE' :: omp_get_team_size
|
||||
!dec$ attributes alias:'OMP_SET_SCHEDULE' :: omp_set_schedule
|
||||
!dec$ attributes alias:'OMP_GET_SCHEDULE' :: omp_get_schedule
|
||||
!dec$ attributes alias:'OMP_GET_PROC_BIND' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'OMP_GET_WTICK' :: omp_get_wtick
|
||||
!dec$ attributes alias:'OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
|
||||
!dec$ attributes alias:'OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
|
||||
!dec$ attributes alias:'OMP_GET_NUM_DEVICES' :: omp_get_num_devices
|
||||
!dec$ attributes alias:'OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
!dec$ attributes alias:'OMP_GET_MAX_TASK_PRIORITY' :: omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'omp_init_lock_with_hint' :: omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'KMP_SET_AFFINITY'::kmp_set_affinity
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY'::kmp_get_affinity
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
|
||||
|
||||
!dec$ else
|
||||
|
||||
!***
|
||||
!*** On Windows* OS IA-32 architecture, the Fortran entry points have an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_OMP_SET_NUM_THREADS' :: omp_set_num_threads
|
||||
!dec$ attributes alias:'_OMP_SET_DYNAMIC' :: omp_set_dynamic
|
||||
!dec$ attributes alias:'_OMP_SET_NESTED' :: omp_set_nested
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_THREADS' :: omp_get_num_threads
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_THREADS' :: omp_get_max_threads
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_NUM' :: omp_get_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_PROCS' :: omp_get_num_procs
|
||||
!dec$ attributes alias:'_OMP_IN_PARALLEL' :: omp_in_parallel
|
||||
!dec$ attributes alias:'_OMP_GET_DYNAMIC' :: omp_get_dynamic
|
||||
!dec$ attributes alias:'_OMP_GET_NESTED' :: omp_get_nested
|
||||
!dec$ attributes alias:'_OMP_GET_THREAD_LIMIT' :: omp_get_thread_limit
|
||||
!dec$ attributes alias:'_OMP_SET_MAX_ACTIVE_LEVELS' :: omp_set_max_active_levels
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_ACTIVE_LEVELS' :: omp_get_max_active_levels
|
||||
!dec$ attributes alias:'_OMP_GET_LEVEL' :: omp_get_level
|
||||
!dec$ attributes alias:'_OMP_GET_ACTIVE_LEVEL' :: omp_get_active_level
|
||||
!dec$ attributes alias:'_OMP_GET_ANCESTOR_THREAD_NUM' :: omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'_OMP_GET_TEAM_SIZE' :: omp_get_team_size
|
||||
!dec$ attributes alias:'_OMP_SET_SCHEDULE' :: omp_set_schedule
|
||||
!dec$ attributes alias:'_OMP_GET_SCHEDULE' :: omp_get_schedule
|
||||
!dec$ attributes alias:'_OMP_GET_PROC_BIND' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'_OMP_GET_WTIME' :: omp_get_wtime
|
||||
!dec$ attributes alias:'_OMP_GET_WTICK' :: omp_get_wtick
|
||||
!dec$ attributes alias:'_OMP_GET_DEFAULT_DEVICE' :: omp_get_default_device
|
||||
!dec$ attributes alias:'_OMP_SET_DEFAULT_DEVICE' :: omp_set_default_device
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_DEVICES' :: omp_get_num_devices
|
||||
!dec$ attributes alias:'_OMP_GET_NUM_TEAMS' :: omp_get_num_teams
|
||||
!dec$ attributes alias:'_OMP_GET_TEAM_NUM' :: omp_get_team_num
|
||||
!dec$ attributes alias:'_OMP_GET_CANCELLATION' :: omp_get_cancellation
|
||||
!dec$ attributes alias:'_OMP_IS_INITIAL_DEVICE' :: omp_is_initial_device
|
||||
!dec$ attributes alias:'_OMP_GET_MAX_TASK_PRIORTY' :: omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock' :: omp_init_lock
|
||||
!dec$ attributes alias:'_omp_init_lock_with_hint' :: omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_lock' :: omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock' :: omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock' :: omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock' :: omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock' :: omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_with_hint' :: omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock' :: omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock' :: omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock' :: omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock' :: omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_KMP_SET_STACKSIZE_S'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_SET_BLOCKTIME'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_SERIAL'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_TURNAROUND'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY_THROUGHPUT'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_KMP_SET_LIBRARY'::kmp_set_library
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_KMP_GET_STACKSIZE_S'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_KMP_GET_BLOCKTIME'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_KMP_GET_LIBRARY'::kmp_get_library
|
||||
!dec$ attributes alias:'_KMP_SET_AFFINITY'::kmp_set_affinity
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY'::kmp_get_affinity
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MAX_PROC'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'_KMP_CREATE_AFFINITY_MASK'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'_KMP_DESTROY_AFFINITY_MASK'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'_KMP_SET_AFFINITY_MASK_PROC'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_UNSET_AFFINITY_MASK_PROC'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_GET_AFFINITY_MASK_PROC'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_KMP_MALLOC'::kmp_malloc
|
||||
!dec$ attributes alias:'_KMP_ALIGNED_MALLOC'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_KMP_CALLOC'::kmp_calloc
|
||||
!dec$ attributes alias:'_KMP_REALLOC'::kmp_realloc
|
||||
!dec$ attributes alias:'_KMP_FREE'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_ON'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_KMP_SET_WARNINGS_OFF'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'_KMP_GET_CANCELLATION_STATUS' :: kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__linux)
|
||||
|
||||
!***
|
||||
!*** The Linux* OS entry points are in lowercase, with an underscore appended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'omp_get_thread_limit_'::omp_get_thread_limit
|
||||
!dec$ attributes alias:'omp_set_max_active_levels_'::omp_set_max_active_levels
|
||||
!dec$ attributes alias:'omp_get_max_active_levels_'::omp_get_max_active_levels
|
||||
!dec$ attributes alias:'omp_get_level_'::omp_get_level
|
||||
!dec$ attributes alias:'omp_get_active_level_'::omp_get_active_level
|
||||
!dec$ attributes alias:'omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'omp_get_team_size_'::omp_get_team_size
|
||||
!dec$ attributes alias:'omp_set_schedule_'::omp_set_schedule
|
||||
!dec$ attributes alias:'omp_get_schedule_'::omp_get_schedule
|
||||
!dec$ attributes alias:'omp_get_proc_bind_' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'omp_get_wtick_'::omp_get_wtick
|
||||
!dec$ attributes alias:'omp_get_default_device_'::omp_get_default_device
|
||||
!dec$ attributes alias:'omp_set_default_device_'::omp_set_default_device
|
||||
!dec$ attributes alias:'omp_get_num_devices_'::omp_get_num_devices
|
||||
!dec$ attributes alias:'omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'omp_is_initial_device_'::omp_is_initial_device
|
||||
!dec$ attributes alias:'omp_get_max_task_priority_'::omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'omp_init_lock_with_hint_'::omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'kmp_set_affinity_'::kmp_set_affinity
|
||||
!dec$ attributes alias:'kmp_get_affinity_'::kmp_get_affinity
|
||||
!dec$ attributes alias:'kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'kmp_create_affinity_mask_'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
!dec$ attributes alias:'kmp_get_cancellation_status_'::kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
|
||||
!dec$ if defined(__APPLE__)
|
||||
|
||||
!***
|
||||
!*** The Mac entry points are in lowercase, with an both an underscore
|
||||
!*** appended and an underscore prepended.
|
||||
!***
|
||||
|
||||
!dec$ attributes alias:'_omp_set_num_threads_'::omp_set_num_threads
|
||||
!dec$ attributes alias:'_omp_set_dynamic_'::omp_set_dynamic
|
||||
!dec$ attributes alias:'_omp_set_nested_'::omp_set_nested
|
||||
!dec$ attributes alias:'_omp_get_num_threads_'::omp_get_num_threads
|
||||
!dec$ attributes alias:'_omp_get_max_threads_'::omp_get_max_threads
|
||||
!dec$ attributes alias:'_omp_get_thread_num_'::omp_get_thread_num
|
||||
!dec$ attributes alias:'_omp_get_num_procs_'::omp_get_num_procs
|
||||
!dec$ attributes alias:'_omp_in_parallel_'::omp_in_parallel
|
||||
!dec$ attributes alias:'_omp_get_dynamic_'::omp_get_dynamic
|
||||
!dec$ attributes alias:'_omp_get_nested_'::omp_get_nested
|
||||
!dec$ attributes alias:'_omp_get_thread_limit_'::omp_get_thread_limit
|
||||
!dec$ attributes alias:'_omp_set_max_active_levels_'::omp_set_max_active_levels
|
||||
!dec$ attributes alias:'_omp_get_max_active_levels_'::omp_get_max_active_levels
|
||||
!dec$ attributes alias:'_omp_get_level_'::omp_get_level
|
||||
!dec$ attributes alias:'_omp_get_active_level_'::omp_get_active_level
|
||||
!dec$ attributes alias:'_omp_get_ancestor_thread_num_'::omp_get_ancestor_thread_num
|
||||
!dec$ attributes alias:'_omp_get_team_size_'::omp_get_team_size
|
||||
!dec$ attributes alias:'_omp_set_schedule_'::omp_set_schedule
|
||||
!dec$ attributes alias:'_omp_get_schedule_'::omp_get_schedule
|
||||
!dec$ attributes alias:'_omp_get_proc_bind_' :: omp_get_proc_bind
|
||||
!dec$ attributes alias:'_omp_get_wtime_'::omp_get_wtime
|
||||
!dec$ attributes alias:'_omp_get_wtick_'::omp_get_wtick
|
||||
!dec$ attributes alias:'_omp_get_num_teams_'::omp_get_num_teams
|
||||
!dec$ attributes alias:'_omp_get_team_num_'::omp_get_team_num
|
||||
!dec$ attributes alias:'_omp_get_cancellation_'::omp_get_cancellation
|
||||
!dec$ attributes alias:'_omp_is_initial_device_'::omp_is_initial_device
|
||||
!dec$ attributes alias:'_omp_get_max_task_priorty_'::omp_get_max_task_priority
|
||||
|
||||
!dec$ attributes alias:'_omp_init_lock_'::omp_init_lock
|
||||
!dec$ attributes alias:'_omp_init_lock_with_hint_'::omp_init_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_lock_'::omp_destroy_lock
|
||||
!dec$ attributes alias:'_omp_set_lock_'::omp_set_lock
|
||||
!dec$ attributes alias:'_omp_unset_lock_'::omp_unset_lock
|
||||
!dec$ attributes alias:'_omp_test_lock_'::omp_test_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_'::omp_init_nest_lock
|
||||
!dec$ attributes alias:'_omp_init_nest_lock_with_hint_'::omp_init_nest_lock_with_hint
|
||||
!dec$ attributes alias:'_omp_destroy_nest_lock_'::omp_destroy_nest_lock
|
||||
!dec$ attributes alias:'_omp_set_nest_lock_'::omp_set_nest_lock
|
||||
!dec$ attributes alias:'_omp_unset_nest_lock_'::omp_unset_nest_lock
|
||||
!dec$ attributes alias:'_omp_test_nest_lock_'::omp_test_nest_lock
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_'::kmp_set_stacksize
|
||||
!dec$ attributes alias:'_kmp_set_stacksize_s_'::kmp_set_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_set_blocktime_'::kmp_set_blocktime
|
||||
!dec$ attributes alias:'_kmp_set_library_serial_'::kmp_set_library_serial
|
||||
!dec$ attributes alias:'_kmp_set_library_turnaround_'::kmp_set_library_turnaround
|
||||
!dec$ attributes alias:'_kmp_set_library_throughput_'::kmp_set_library_throughput
|
||||
!dec$ attributes alias:'_kmp_set_library_'::kmp_set_library
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_'::kmp_get_stacksize
|
||||
!dec$ attributes alias:'_kmp_get_stacksize_s_'::kmp_get_stacksize_s
|
||||
!dec$ attributes alias:'_kmp_get_blocktime_'::kmp_get_blocktime
|
||||
!dec$ attributes alias:'_kmp_get_library_'::kmp_get_library
|
||||
!dec$ attributes alias:'_kmp_set_affinity_'::kmp_set_affinity
|
||||
!dec$ attributes alias:'_kmp_get_affinity_'::kmp_get_affinity
|
||||
!dec$ attributes alias:'_kmp_get_affinity_max_proc_'::kmp_get_affinity_max_proc
|
||||
!dec$ attributes alias:'_kmp_create_affinity_mask_'::kmp_create_affinity_mask
|
||||
!dec$ attributes alias:'_kmp_destroy_affinity_mask_'::kmp_destroy_affinity_mask
|
||||
!dec$ attributes alias:'_kmp_set_affinity_mask_proc_'::kmp_set_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_unset_affinity_mask_proc_'::kmp_unset_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_get_affinity_mask_proc_'::kmp_get_affinity_mask_proc
|
||||
!dec$ attributes alias:'_kmp_malloc_'::kmp_malloc
|
||||
!dec$ attributes alias:'_kmp_aligned_malloc_'::kmp_aligned_malloc
|
||||
!dec$ attributes alias:'_kmp_calloc_'::kmp_calloc
|
||||
!dec$ attributes alias:'_kmp_realloc_'::kmp_realloc
|
||||
!dec$ attributes alias:'_kmp_free_'::kmp_free
|
||||
|
||||
!dec$ attributes alias:'_kmp_set_warnings_on_'::kmp_set_warnings_on
|
||||
!dec$ attributes alias:'_kmp_set_warnings_off_'::kmp_set_warnings_off
|
||||
|
||||
!dec$ attributes alias:'_kmp_get_cancellation_status_'::kmp_get_cancellation_status
|
||||
|
||||
!dec$ endif
|
||||
|
||||
end module omp_lib
|
||||
|
||||
@@ -0,0 +1,524 @@
|
||||
! include/50/omp_lib.f90.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
module omp_lib_kinds
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
|
||||
integer, parameter :: omp_integer_kind = c_int
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = c_float
|
||||
integer, parameter :: kmp_double_kind = c_double
|
||||
integer, parameter :: omp_lock_kind = c_intptr_t
|
||||
integer, parameter :: omp_nest_lock_kind = c_intptr_t
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = c_intptr_t
|
||||
integer, parameter :: kmp_size_t_kind = c_size_t
|
||||
integer, parameter :: kmp_affinity_mask_kind = c_intptr_t
|
||||
integer, parameter :: kmp_cancel_kind = omp_integer_kind
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
end module omp_lib_kinds
|
||||
|
||||
module omp_lib
|
||||
|
||||
use omp_lib_kinds
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_parallel = 1
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_loop = 2
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3
|
||||
integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick() bind(c)
|
||||
use omp_lib_kinds
|
||||
real (kind=kmp_double_kind) omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_get_cancellation() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_cancellation
|
||||
end function omp_get_cancellation
|
||||
|
||||
function omp_is_initial_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial() bind(c)
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround() bind(c)
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput() bind(c)
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string) bind(c)
|
||||
use, intrinsic :: iso_c_binding
|
||||
character (kind=c_char) :: string(*)
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind), value :: num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc() bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind), value :: nelem
|
||||
integer (kind=kmp_size_t_kind), value :: elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on() bind(c)
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off() bind(c)
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
function kmp_get_cancellation_status(cancelkind) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=kmp_cancel_kind), value :: cancelkind
|
||||
logical (kind=omp_logical_kind) kmp_get_cancellation_status
|
||||
end function kmp_get_cancellation_status
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
|
||||
use omp_lib_kinds
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
end module omp_lib
|
||||
@@ -0,0 +1,644 @@
|
||||
! include/50/omp_lib.h.var
|
||||
|
||||
!
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!//
|
||||
!// The LLVM Compiler Infrastructure
|
||||
!//
|
||||
!// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
!// Source Licenses. See LICENSE.txt for details.
|
||||
!//
|
||||
!//===----------------------------------------------------------------------===//
|
||||
!
|
||||
|
||||
!***
|
||||
!*** Some of the directives for the following routine extend past column 72,
|
||||
!*** so process this file in 132-column mode.
|
||||
!***
|
||||
|
||||
!DIR$ fixedformlinesize:132
|
||||
|
||||
integer, parameter :: omp_integer_kind = 4
|
||||
integer, parameter :: omp_logical_kind = 4
|
||||
integer, parameter :: omp_real_kind = 4
|
||||
integer, parameter :: omp_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_nest_lock_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_sched_kind = omp_integer_kind
|
||||
integer, parameter :: omp_proc_bind_kind = omp_integer_kind
|
||||
integer, parameter :: kmp_pointer_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_size_t_kind = int_ptr_kind()
|
||||
integer, parameter :: kmp_affinity_mask_kind = int_ptr_kind()
|
||||
integer, parameter :: omp_lock_hint_kind = omp_integer_kind
|
||||
|
||||
integer (kind=omp_integer_kind), parameter :: openmp_version = @LIBOMP_OMP_YEAR_MONTH@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_major = @LIBOMP_VERSION_MAJOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_minor = @LIBOMP_VERSION_MINOR@
|
||||
integer (kind=omp_integer_kind), parameter :: kmp_version_build = @LIBOMP_VERSION_BUILD@
|
||||
character(*) kmp_build_date
|
||||
parameter( kmp_build_date = '@LIBOMP_BUILD_DATE@' )
|
||||
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_static = 1
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_dynamic = 2
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_guided = 3
|
||||
integer(kind=omp_sched_kind), parameter :: omp_sched_auto = 4
|
||||
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_false = 0
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_true = 1
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_master = 2
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_close = 3
|
||||
integer (kind=omp_proc_bind_kind), parameter :: omp_proc_bind_spread = 4
|
||||
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4
|
||||
integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072
|
||||
integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144
|
||||
|
||||
interface
|
||||
|
||||
! ***
|
||||
! *** omp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine omp_set_num_threads(num_threads) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: num_threads
|
||||
end subroutine omp_set_num_threads
|
||||
|
||||
subroutine omp_set_dynamic(dynamic_threads) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: dynamic_threads
|
||||
end subroutine omp_set_dynamic
|
||||
|
||||
subroutine omp_set_nested(nested) bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind), value :: nested
|
||||
end subroutine omp_set_nested
|
||||
|
||||
function omp_get_num_threads() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_threads
|
||||
end function omp_get_num_threads
|
||||
|
||||
function omp_get_max_threads() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_threads
|
||||
end function omp_get_max_threads
|
||||
|
||||
function omp_get_thread_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_thread_num
|
||||
end function omp_get_thread_num
|
||||
|
||||
function omp_get_num_procs() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_procs
|
||||
end function omp_get_num_procs
|
||||
|
||||
function omp_in_parallel() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_parallel
|
||||
end function omp_in_parallel
|
||||
|
||||
function omp_in_final() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_in_final
|
||||
end function omp_in_final
|
||||
|
||||
function omp_get_dynamic() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_dynamic
|
||||
end function omp_get_dynamic
|
||||
|
||||
function omp_get_nested() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_get_nested
|
||||
end function omp_get_nested
|
||||
|
||||
function omp_get_thread_limit() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_thread_limit
|
||||
end function omp_get_thread_limit
|
||||
|
||||
subroutine omp_set_max_active_levels(max_levels) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: max_levels
|
||||
end subroutine omp_set_max_active_levels
|
||||
|
||||
function omp_get_max_active_levels() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_active_levels
|
||||
end function omp_get_max_active_levels
|
||||
|
||||
function omp_get_level() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_level
|
||||
end function omp_get_level
|
||||
|
||||
function omp_get_active_level() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_active_level
|
||||
end function omp_get_active_level
|
||||
|
||||
function omp_get_ancestor_thread_num(level) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_ancestor_thread_num
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_ancestor_thread_num
|
||||
|
||||
function omp_get_team_size(level) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_team_size
|
||||
integer (kind=omp_integer_kind), value :: level
|
||||
end function omp_get_team_size
|
||||
|
||||
subroutine omp_set_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind), value :: kind
|
||||
integer (kind=omp_integer_kind), value :: chunk_size
|
||||
end subroutine omp_set_schedule
|
||||
|
||||
subroutine omp_get_schedule(kind, chunk_size) bind(c)
|
||||
import
|
||||
integer (kind=omp_sched_kind) kind
|
||||
integer (kind=omp_integer_kind) chunk_size
|
||||
end subroutine omp_get_schedule
|
||||
|
||||
function omp_get_proc_bind() bind(c)
|
||||
import
|
||||
integer (kind=omp_proc_bind_kind) omp_get_proc_bind
|
||||
end function omp_get_proc_bind
|
||||
|
||||
function omp_get_num_places() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_places
|
||||
end function omp_get_num_places
|
||||
|
||||
function omp_get_place_num_procs(place_num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=omp_integer_kind) omp_get_place_num_procs
|
||||
end function omp_get_place_num_procs
|
||||
|
||||
subroutine omp_get_place_proc_ids(place_num, ids) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: place_num
|
||||
integer (kind=kmp_pointer_kind) ids(*)
|
||||
end subroutine omp_get_place_proc_ids
|
||||
|
||||
function omp_get_place_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_place_num
|
||||
end function omp_get_place_num
|
||||
|
||||
function omp_get_partition_num_places() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_partition_num_places
|
||||
end function omp_get_partition_num_places
|
||||
|
||||
subroutine omp_get_partition_place_nums(place_nums) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) place_nums(*)
|
||||
end subroutine omp_get_partition_place_nums
|
||||
|
||||
function omp_get_wtime() bind(c)
|
||||
double precision omp_get_wtime
|
||||
end function omp_get_wtime
|
||||
|
||||
function omp_get_wtick() bind(c)
|
||||
double precision omp_get_wtick
|
||||
end function omp_get_wtick
|
||||
|
||||
function omp_get_default_device() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_default_device
|
||||
end function omp_get_default_device
|
||||
|
||||
subroutine omp_set_default_device(device_num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: device_num
|
||||
end subroutine omp_set_default_device
|
||||
|
||||
function omp_get_num_devices() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_devices
|
||||
end function omp_get_num_devices
|
||||
|
||||
function omp_get_num_teams() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_num_teams
|
||||
end function omp_get_num_teams
|
||||
|
||||
function omp_get_team_num() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_team_num
|
||||
end function omp_get_team_num
|
||||
|
||||
function omp_is_initial_device() bind(c)
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_is_initial_device
|
||||
end function omp_is_initial_device
|
||||
|
||||
function omp_get_initial_device() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_initial_device
|
||||
end function omp_get_initial_device
|
||||
|
||||
subroutine omp_init_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_init_lock
|
||||
|
||||
subroutine omp_destroy_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_destroy_lock
|
||||
|
||||
subroutine omp_set_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_set_lock
|
||||
|
||||
subroutine omp_unset_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end subroutine omp_unset_lock
|
||||
|
||||
function omp_test_lock(svar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
logical (kind=omp_logical_kind) omp_test_lock
|
||||
integer (kind=omp_lock_kind) svar
|
||||
end function omp_test_lock
|
||||
|
||||
subroutine omp_init_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_init_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_init_nest_lock
|
||||
|
||||
subroutine omp_destroy_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_destroy_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_destroy_nest_lock
|
||||
|
||||
subroutine omp_set_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_set_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_set_nest_lock
|
||||
|
||||
subroutine omp_unset_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_unset_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end subroutine omp_unset_nest_lock
|
||||
|
||||
function omp_test_nest_lock(nvar) bind(c)
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!DIR$ attributes known_intrinsic :: omp_test_nest_lock
|
||||
!DIR$ ENDIF
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_test_nest_lock
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
end function omp_test_nest_lock
|
||||
|
||||
function omp_get_max_task_priority() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) omp_get_max_task_priority
|
||||
end function omp_get_max_task_priority
|
||||
|
||||
! ***
|
||||
! *** kmp_* entry points
|
||||
! ***
|
||||
|
||||
subroutine kmp_set_stacksize(size) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: size
|
||||
end subroutine kmp_set_stacksize
|
||||
|
||||
subroutine kmp_set_stacksize_s(size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end subroutine kmp_set_stacksize_s
|
||||
|
||||
subroutine kmp_set_blocktime(msec) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: msec
|
||||
end subroutine kmp_set_blocktime
|
||||
|
||||
subroutine kmp_set_library_serial() bind(c)
|
||||
end subroutine kmp_set_library_serial
|
||||
|
||||
subroutine kmp_set_library_turnaround() bind(c)
|
||||
end subroutine kmp_set_library_turnaround
|
||||
|
||||
subroutine kmp_set_library_throughput() bind(c)
|
||||
end subroutine kmp_set_library_throughput
|
||||
|
||||
subroutine kmp_set_library(libnum) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: libnum
|
||||
end subroutine kmp_set_library
|
||||
|
||||
subroutine kmp_set_defaults(string) bind(c)
|
||||
character string(*)
|
||||
end subroutine kmp_set_defaults
|
||||
|
||||
function kmp_get_stacksize() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_stacksize
|
||||
end function kmp_get_stacksize
|
||||
|
||||
function kmp_get_stacksize_s() bind(c)
|
||||
import
|
||||
integer (kind=kmp_size_t_kind) kmp_get_stacksize_s
|
||||
end function kmp_get_stacksize_s
|
||||
|
||||
function kmp_get_blocktime() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_blocktime
|
||||
end function kmp_get_blocktime
|
||||
|
||||
function kmp_get_library() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_library
|
||||
end function kmp_get_library
|
||||
|
||||
subroutine kmp_set_disp_num_buffers(num) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind), value :: num
|
||||
end subroutine kmp_set_disp_num_buffers
|
||||
|
||||
function kmp_set_affinity(mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity
|
||||
|
||||
function kmp_get_affinity(mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity
|
||||
|
||||
function kmp_get_affinity_max_proc() bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_max_proc
|
||||
end function kmp_get_affinity_max_proc
|
||||
|
||||
subroutine kmp_create_affinity_mask(mask) bind(c)
|
||||
import
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_create_affinity_mask
|
||||
|
||||
subroutine kmp_destroy_affinity_mask(mask) bind(c)
|
||||
import
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end subroutine kmp_destroy_affinity_mask
|
||||
|
||||
function kmp_set_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_set_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_set_affinity_mask_proc
|
||||
|
||||
function kmp_unset_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_unset_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_unset_affinity_mask_proc
|
||||
|
||||
function kmp_get_affinity_mask_proc(proc, mask) bind(c)
|
||||
import
|
||||
integer (kind=omp_integer_kind) kmp_get_affinity_mask_proc
|
||||
integer (kind=omp_integer_kind), value :: proc
|
||||
integer (kind=kmp_affinity_mask_kind) mask
|
||||
end function kmp_get_affinity_mask_proc
|
||||
|
||||
function kmp_malloc(size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_malloc
|
||||
|
||||
function kmp_aligned_malloc(size, alignment) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_aligned_malloc
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
integer (kind=kmp_size_t_kind), value :: alignment
|
||||
end function kmp_aligned_malloc
|
||||
|
||||
function kmp_calloc(nelem, elsize) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_calloc
|
||||
integer (kind=kmp_size_t_kind), value :: nelem
|
||||
integer (kind=kmp_size_t_kind), value :: elsize
|
||||
end function kmp_calloc
|
||||
|
||||
function kmp_realloc(ptr, size) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind) kmp_realloc
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
integer (kind=kmp_size_t_kind), value :: size
|
||||
end function kmp_realloc
|
||||
|
||||
subroutine kmp_free(ptr) bind(c)
|
||||
import
|
||||
integer (kind=kmp_pointer_kind), value :: ptr
|
||||
end subroutine kmp_free
|
||||
|
||||
subroutine kmp_set_warnings_on() bind(c)
|
||||
end subroutine kmp_set_warnings_on
|
||||
|
||||
subroutine kmp_set_warnings_off() bind(c)
|
||||
end subroutine kmp_set_warnings_off
|
||||
|
||||
subroutine omp_init_lock_with_hint(svar, hint) bind(c)
|
||||
import
|
||||
integer (kind=omp_lock_kind) svar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_lock_with_hint
|
||||
|
||||
subroutine omp_init_nest_lock_with_hint(nvar, hint) bind(c)
|
||||
import
|
||||
integer (kind=omp_nest_lock_kind) nvar
|
||||
integer (kind=omp_lock_hint_kind), value :: hint
|
||||
end subroutine omp_init_nest_lock_with_hint
|
||||
|
||||
end interface
|
||||
|
||||
!DIR$ IF DEFINED (__INTEL_OFFLOAD)
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_num_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_dynamic
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nested
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_threads
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_procs
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_parallel
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_in_final
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_dynamic
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_nested
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_thread_limit
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_max_active_levels
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_active_levels
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_level
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_active_level
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_ancestor_thread_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_size
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_schedule
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_schedule
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_proc_bind
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_wtick
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_default_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_is_initial_device
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_devices
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_num_teams
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_team_num
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_destroy_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_set_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_unset_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_test_nest_lock
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_get_max_task_priority
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_stacksize_s
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_blocktime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_serial
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_turnaround
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library_throughput
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_library
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_defaults
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_stacksize_s
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_blocktime
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_library
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_disp_num_buffers
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_max_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_create_affinity_mask
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_destroy_affinity_mask
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_unset_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_get_affinity_mask_proc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_aligned_malloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_calloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_realloc
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_free
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_on
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: kmp_set_warnings_off
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_lock_with_hint
|
||||
!DIR$ ATTRIBUTES OFFLOAD:MIC :: omp_init_nest_lock_with_hint
|
||||
|
||||
!DIR$ IF(__INTEL_COMPILER.GE.1400)
|
||||
!$omp declare target(omp_set_num_threads )
|
||||
!$omp declare target(omp_set_dynamic )
|
||||
!$omp declare target(omp_set_nested )
|
||||
!$omp declare target(omp_get_num_threads )
|
||||
!$omp declare target(omp_get_max_threads )
|
||||
!$omp declare target(omp_get_thread_num )
|
||||
!$omp declare target(omp_get_num_procs )
|
||||
!$omp declare target(omp_in_parallel )
|
||||
!$omp declare target(omp_in_final )
|
||||
!$omp declare target(omp_get_dynamic )
|
||||
!$omp declare target(omp_get_nested )
|
||||
!$omp declare target(omp_get_thread_limit )
|
||||
!$omp declare target(omp_set_max_active_levels )
|
||||
!$omp declare target(omp_get_max_active_levels )
|
||||
!$omp declare target(omp_get_level )
|
||||
!$omp declare target(omp_get_active_level )
|
||||
!$omp declare target(omp_get_ancestor_thread_num )
|
||||
!$omp declare target(omp_get_team_size )
|
||||
!$omp declare target(omp_set_schedule )
|
||||
!$omp declare target(omp_get_schedule )
|
||||
!$omp declare target(omp_get_proc_bind )
|
||||
!$omp declare target(omp_get_wtime )
|
||||
!$omp declare target(omp_get_wtick )
|
||||
!$omp declare target(omp_get_default_device )
|
||||
!$omp declare target(omp_set_default_device )
|
||||
!$omp declare target(omp_is_initial_device )
|
||||
!$omp declare target(omp_get_num_devices )
|
||||
!$omp declare target(omp_get_num_teams )
|
||||
!$omp declare target(omp_get_team_num )
|
||||
!$omp declare target(omp_init_lock )
|
||||
!$omp declare target(omp_destroy_lock )
|
||||
!$omp declare target(omp_set_lock )
|
||||
!$omp declare target(omp_unset_lock )
|
||||
!$omp declare target(omp_test_lock )
|
||||
!$omp declare target(omp_init_nest_lock )
|
||||
!$omp declare target(omp_destroy_nest_lock )
|
||||
!$omp declare target(omp_set_nest_lock )
|
||||
!$omp declare target(omp_unset_nest_lock )
|
||||
!$omp declare target(omp_test_nest_lock )
|
||||
!$omp declare target(omp_get_max_task_priority )
|
||||
!$omp declare target(kmp_set_stacksize )
|
||||
!$omp declare target(kmp_set_stacksize_s )
|
||||
!$omp declare target(kmp_set_blocktime )
|
||||
!$omp declare target(kmp_set_library_serial )
|
||||
!$omp declare target(kmp_set_library_turnaround )
|
||||
!$omp declare target(kmp_set_library_throughput )
|
||||
!$omp declare target(kmp_set_library )
|
||||
!$omp declare target(kmp_set_defaults )
|
||||
!$omp declare target(kmp_get_stacksize )
|
||||
!$omp declare target(kmp_get_stacksize_s )
|
||||
!$omp declare target(kmp_get_blocktime )
|
||||
!$omp declare target(kmp_get_library )
|
||||
!$omp declare target(kmp_set_disp_num_buffers )
|
||||
!$omp declare target(kmp_set_affinity )
|
||||
!$omp declare target(kmp_get_affinity )
|
||||
!$omp declare target(kmp_get_affinity_max_proc )
|
||||
!$omp declare target(kmp_create_affinity_mask )
|
||||
!$omp declare target(kmp_destroy_affinity_mask )
|
||||
!$omp declare target(kmp_set_affinity_mask_proc )
|
||||
!$omp declare target(kmp_unset_affinity_mask_proc )
|
||||
!$omp declare target(kmp_get_affinity_mask_proc )
|
||||
!$omp declare target(kmp_malloc )
|
||||
!$omp declare target(kmp_aligned_malloc )
|
||||
!$omp declare target(kmp_calloc )
|
||||
!$omp declare target(kmp_realloc )
|
||||
!$omp declare target(kmp_free )
|
||||
!$omp declare target(kmp_set_warnings_on )
|
||||
!$omp declare target(kmp_set_warnings_off )
|
||||
!$omp declare target(omp_init_lock_with_hint )
|
||||
!$omp declare target(omp_init_nest_lock_with_hint )
|
||||
!DIR$ ENDIF
|
||||
!DIR$ ENDIF
|
||||
|
||||
@@ -0,0 +1,515 @@
|
||||
/*
|
||||
* include/50/ompt.h.var
|
||||
*/
|
||||
|
||||
#ifndef __OMPT__
|
||||
#define __OMPT__
|
||||
|
||||
/*****************************************************************************
|
||||
* system include files
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* iteration macros
|
||||
*****************************************************************************/
|
||||
|
||||
#define FOREACH_OMPT_INQUIRY_FN(macro) \
|
||||
macro (ompt_enumerate_state) \
|
||||
\
|
||||
macro (ompt_set_callback) \
|
||||
macro (ompt_get_callback) \
|
||||
\
|
||||
macro (ompt_get_idle_frame) \
|
||||
macro (ompt_get_task_frame) \
|
||||
\
|
||||
macro (ompt_get_state) \
|
||||
\
|
||||
macro (ompt_get_parallel_id) \
|
||||
macro (ompt_get_parallel_team_size) \
|
||||
macro (ompt_get_task_id) \
|
||||
macro (ompt_get_thread_id)
|
||||
|
||||
#define FOREACH_OMPT_PLACEHOLDER_FN(macro) \
|
||||
macro (ompt_idle) \
|
||||
macro (ompt_overhead) \
|
||||
macro (ompt_barrier_wait) \
|
||||
macro (ompt_task_wait) \
|
||||
macro (ompt_mutex_wait)
|
||||
|
||||
#define FOREACH_OMPT_STATE(macro) \
|
||||
\
|
||||
/* first */ \
|
||||
macro (ompt_state_first, 0x71) /* initial enumeration state */ \
|
||||
\
|
||||
/* work states (0..15) */ \
|
||||
macro (ompt_state_work_serial, 0x00) /* working outside parallel */ \
|
||||
macro (ompt_state_work_parallel, 0x01) /* working within parallel */ \
|
||||
macro (ompt_state_work_reduction, 0x02) /* performing a reduction */ \
|
||||
\
|
||||
/* idle (16..31) */ \
|
||||
macro (ompt_state_idle, 0x10) /* waiting for work */ \
|
||||
\
|
||||
/* overhead states (32..63) */ \
|
||||
macro (ompt_state_overhead, 0x20) /* overhead excluding wait states */ \
|
||||
\
|
||||
/* barrier wait states (64..79) */ \
|
||||
macro (ompt_state_wait_barrier, 0x40) /* waiting at a barrier */ \
|
||||
macro (ompt_state_wait_barrier_implicit, 0x41) /* implicit barrier */ \
|
||||
macro (ompt_state_wait_barrier_explicit, 0x42) /* explicit barrier */ \
|
||||
\
|
||||
/* task wait states (80..95) */ \
|
||||
macro (ompt_state_wait_taskwait, 0x50) /* waiting at a taskwait */ \
|
||||
macro (ompt_state_wait_taskgroup, 0x51) /* waiting at a taskgroup */ \
|
||||
\
|
||||
/* mutex wait states (96..111) */ \
|
||||
macro (ompt_state_wait_lock, 0x60) /* waiting for lock */ \
|
||||
macro (ompt_state_wait_nest_lock, 0x61) /* waiting for nest lock */ \
|
||||
macro (ompt_state_wait_critical, 0x62) /* waiting for critical */ \
|
||||
macro (ompt_state_wait_atomic, 0x63) /* waiting for atomic */ \
|
||||
macro (ompt_state_wait_ordered, 0x64) /* waiting for ordered */ \
|
||||
macro (ompt_state_wait_single, 0x6F) /* waiting for single region (non-standard!) */ \
|
||||
\
|
||||
/* misc (112..127) */ \
|
||||
macro (ompt_state_undefined, 0x70) /* undefined thread state */
|
||||
|
||||
|
||||
#define FOREACH_OMPT_EVENT(macro) \
|
||||
\
|
||||
/*--- Mandatory Events ---*/ \
|
||||
macro (ompt_event_parallel_begin, ompt_new_parallel_callback_t, 1) /* parallel begin */ \
|
||||
macro (ompt_event_parallel_end, ompt_end_parallel_callback_t, 2) /* parallel end */ \
|
||||
\
|
||||
macro (ompt_event_task_begin, ompt_new_task_callback_t, 3) /* task begin */ \
|
||||
macro (ompt_event_task_end, ompt_task_callback_t, 4) /* task destroy */ \
|
||||
\
|
||||
macro (ompt_event_thread_begin, ompt_thread_type_callback_t, 5) /* thread begin */ \
|
||||
macro (ompt_event_thread_end, ompt_thread_type_callback_t, 6) /* thread end */ \
|
||||
\
|
||||
macro (ompt_event_control, ompt_control_callback_t, 7) /* support control calls */ \
|
||||
\
|
||||
macro (ompt_event_runtime_shutdown, ompt_callback_t, 8) /* runtime shutdown */ \
|
||||
\
|
||||
/*--- Optional Events (blame shifting, ompt_event_unimplemented) ---*/ \
|
||||
macro (ompt_event_idle_begin, ompt_thread_callback_t, 9) /* begin idle state */ \
|
||||
macro (ompt_event_idle_end, ompt_thread_callback_t, 10) /* end idle state */ \
|
||||
\
|
||||
macro (ompt_event_wait_barrier_begin, ompt_parallel_callback_t, 11) /* begin wait at barrier */ \
|
||||
macro (ompt_event_wait_barrier_end, ompt_parallel_callback_t, 12) /* end wait at barrier */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskwait_begin, ompt_parallel_callback_t, 13) /* begin wait at taskwait */ \
|
||||
macro (ompt_event_wait_taskwait_end, ompt_parallel_callback_t, 14) /* end wait at taskwait */ \
|
||||
\
|
||||
macro (ompt_event_wait_taskgroup_begin, ompt_parallel_callback_t, 15) /* begin wait at taskgroup */\
|
||||
macro (ompt_event_wait_taskgroup_end, ompt_parallel_callback_t, 16) /* end wait at taskgroup */ \
|
||||
\
|
||||
macro (ompt_event_release_lock, ompt_wait_callback_t, 17) /* lock release */ \
|
||||
macro (ompt_event_release_nest_lock_last, ompt_wait_callback_t, 18) /* last nest lock release */ \
|
||||
macro (ompt_event_release_critical, ompt_wait_callback_t, 19) /* critical release */ \
|
||||
\
|
||||
macro (ompt_event_release_atomic, ompt_wait_callback_t, 20) /* atomic release */ \
|
||||
\
|
||||
macro (ompt_event_release_ordered, ompt_wait_callback_t, 21) /* ordered release */ \
|
||||
\
|
||||
/*--- Optional Events (synchronous events, ompt_event_unimplemented) --- */ \
|
||||
macro (ompt_event_implicit_task_begin, ompt_parallel_callback_t, 22) /* implicit task begin */ \
|
||||
macro (ompt_event_implicit_task_end, ompt_parallel_callback_t, 23) /* implicit task end */ \
|
||||
\
|
||||
macro (ompt_event_initial_task_begin, ompt_parallel_callback_t, 24) /* initial task begin */ \
|
||||
macro (ompt_event_initial_task_end, ompt_parallel_callback_t, 25) /* initial task end */ \
|
||||
\
|
||||
macro (ompt_event_task_switch, ompt_task_pair_callback_t, 26) /* task switch */ \
|
||||
\
|
||||
macro (ompt_event_loop_begin, ompt_new_workshare_callback_t, 27) /* task at loop begin */ \
|
||||
macro (ompt_event_loop_end, ompt_parallel_callback_t, 28) /* task at loop end */ \
|
||||
\
|
||||
macro (ompt_event_sections_begin, ompt_new_workshare_callback_t, 29) /* task at sections begin */\
|
||||
macro (ompt_event_sections_end, ompt_parallel_callback_t, 30) /* task at sections end */ \
|
||||
\
|
||||
macro (ompt_event_single_in_block_begin, ompt_new_workshare_callback_t, 31) /* task at single begin*/ \
|
||||
macro (ompt_event_single_in_block_end, ompt_parallel_callback_t, 32) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_single_others_begin, ompt_parallel_callback_t, 33) /* task at single begin */ \
|
||||
macro (ompt_event_single_others_end, ompt_parallel_callback_t, 34) /* task at single end */ \
|
||||
\
|
||||
macro (ompt_event_workshare_begin, ompt_new_workshare_callback_t, 35) /* task at workshare begin */\
|
||||
macro (ompt_event_workshare_end, ompt_parallel_callback_t, 36) /* task at workshare end */ \
|
||||
\
|
||||
macro (ompt_event_master_begin, ompt_parallel_callback_t, 37) /* task at master begin */ \
|
||||
macro (ompt_event_master_end, ompt_parallel_callback_t, 38) /* task at master end */ \
|
||||
\
|
||||
macro (ompt_event_barrier_begin, ompt_parallel_callback_t, 39) /* task at barrier begin */ \
|
||||
macro (ompt_event_barrier_end, ompt_parallel_callback_t, 40) /* task at barrier end */ \
|
||||
\
|
||||
macro (ompt_event_taskwait_begin, ompt_parallel_callback_t, 41) /* task at taskwait begin */ \
|
||||
macro (ompt_event_taskwait_end, ompt_parallel_callback_t, 42) /* task at task wait end */ \
|
||||
\
|
||||
macro (ompt_event_taskgroup_begin, ompt_parallel_callback_t, 43) /* task at taskgroup begin */\
|
||||
macro (ompt_event_taskgroup_end, ompt_parallel_callback_t, 44) /* task at taskgroup end */ \
|
||||
\
|
||||
macro (ompt_event_release_nest_lock_prev, ompt_wait_callback_t, 45) /* prev nest lock release */ \
|
||||
\
|
||||
macro (ompt_event_wait_lock, ompt_wait_callback_t, 46) /* lock wait */ \
|
||||
macro (ompt_event_wait_nest_lock, ompt_wait_callback_t, 47) /* nest lock wait */ \
|
||||
macro (ompt_event_wait_critical, ompt_wait_callback_t, 48) /* critical wait */ \
|
||||
macro (ompt_event_wait_atomic, ompt_wait_callback_t, 49) /* atomic wait */ \
|
||||
macro (ompt_event_wait_ordered, ompt_wait_callback_t, 50) /* ordered wait */ \
|
||||
\
|
||||
macro (ompt_event_acquired_lock, ompt_wait_callback_t, 51) /* lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_first, ompt_wait_callback_t, 52) /* 1st nest lock acquired */ \
|
||||
macro (ompt_event_acquired_nest_lock_next, ompt_wait_callback_t, 53) /* next nest lock acquired*/ \
|
||||
macro (ompt_event_acquired_critical, ompt_wait_callback_t, 54) /* critical acquired */ \
|
||||
macro (ompt_event_acquired_atomic, ompt_wait_callback_t, 55) /* atomic acquired */ \
|
||||
macro (ompt_event_acquired_ordered, ompt_wait_callback_t, 56) /* ordered acquired */ \
|
||||
\
|
||||
macro (ompt_event_init_lock, ompt_wait_callback_t, 57) /* lock init */ \
|
||||
macro (ompt_event_init_nest_lock, ompt_wait_callback_t, 58) /* nest lock init */ \
|
||||
\
|
||||
macro (ompt_event_destroy_lock, ompt_wait_callback_t, 59) /* lock destruction */ \
|
||||
macro (ompt_event_destroy_nest_lock, ompt_wait_callback_t, 60) /* nest lock destruction */ \
|
||||
\
|
||||
macro (ompt_event_flush, ompt_callback_t, 61) /* after executing flush */ \
|
||||
\
|
||||
macro (ompt_event_task_dependences, ompt_task_dependences_callback_t, 69) /* report task dependences */\
|
||||
macro (ompt_event_task_dependence_pair, ompt_task_pair_callback_t, 70) /* report task dependence pair */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* data types
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* identifiers
|
||||
*---------------------*/
|
||||
|
||||
typedef uint64_t ompt_thread_id_t;
|
||||
#define ompt_thread_id_none ((ompt_thread_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_task_id_t;
|
||||
#define ompt_task_id_none ((ompt_task_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_parallel_id_t;
|
||||
#define ompt_parallel_id_none ((ompt_parallel_id_t) 0) /* non-standard */
|
||||
|
||||
typedef uint64_t ompt_wait_id_t;
|
||||
#define ompt_wait_id_none ((ompt_wait_id_t) 0) /* non-standard */
|
||||
|
||||
|
||||
/*---------------------
|
||||
* ompt_frame_t
|
||||
*---------------------*/
|
||||
|
||||
typedef struct ompt_frame_s {
|
||||
void *exit_runtime_frame; /* next frame is user code */
|
||||
void *reenter_runtime_frame; /* previous frame is user code */
|
||||
} ompt_frame_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* dependences types
|
||||
*---------------------*/
|
||||
|
||||
typedef enum ompt_task_dependence_flag_e {
|
||||
// a two bit field for the dependence type
|
||||
ompt_task_dependence_type_out = 1,
|
||||
ompt_task_dependence_type_in = 2,
|
||||
ompt_task_dependence_type_inout = 3,
|
||||
} ompt_task_dependence_flag_t;
|
||||
|
||||
typedef struct ompt_task_dependence_s {
|
||||
void *variable_addr;
|
||||
uint32_t dependence_flags;
|
||||
} ompt_task_dependence_t;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* enumerations for thread states and runtime events
|
||||
*****************************************************************************/
|
||||
|
||||
/*---------------------
|
||||
* runtime states
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_state_macro(state, code) state = code,
|
||||
FOREACH_OMPT_STATE(ompt_state_macro)
|
||||
#undef ompt_state_macro
|
||||
} ompt_state_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* runtime events
|
||||
*---------------------*/
|
||||
|
||||
typedef enum {
|
||||
#define ompt_event_macro(event, callback, eventid) event = eventid,
|
||||
FOREACH_OMPT_EVENT(ompt_event_macro)
|
||||
#undef ompt_event_macro
|
||||
} ompt_event_t;
|
||||
|
||||
|
||||
/*---------------------
|
||||
* set callback results
|
||||
*---------------------*/
|
||||
typedef enum {
|
||||
ompt_set_result_registration_error = 0,
|
||||
ompt_set_result_event_may_occur_no_callback = 1,
|
||||
ompt_set_result_event_never_occurs = 2,
|
||||
ompt_set_result_event_may_occur_callback_some = 3,
|
||||
ompt_set_result_event_may_occur_callback_always = 4,
|
||||
} ompt_set_result_t;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* callback signatures
|
||||
*****************************************************************************/
|
||||
|
||||
/* initialization */
|
||||
typedef void (*ompt_interface_fn_t)(void);
|
||||
|
||||
typedef ompt_interface_fn_t (*ompt_function_lookup_t)(
|
||||
const char * /* entry point to look up */
|
||||
);
|
||||
|
||||
/* threads */
|
||||
typedef void (*ompt_thread_callback_t) (
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
ompt_thread_initial = 1, // start the enumeration at 1
|
||||
ompt_thread_worker = 2,
|
||||
ompt_thread_other = 3
|
||||
} ompt_thread_type_t;
|
||||
|
||||
typedef enum {
|
||||
ompt_invoker_program = 0, /* program invokes master task */
|
||||
ompt_invoker_runtime = 1 /* runtime invokes master task */
|
||||
} ompt_invoker_t;
|
||||
|
||||
typedef void (*ompt_thread_type_callback_t) (
|
||||
ompt_thread_type_t thread_type, /* type of thread */
|
||||
ompt_thread_id_t thread_id /* ID of thread */
|
||||
);
|
||||
|
||||
typedef void (*ompt_wait_callback_t) (
|
||||
ompt_wait_id_t wait_id /* wait id */
|
||||
);
|
||||
|
||||
/* parallel and workshares */
|
||||
typedef void (*ompt_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_workshare_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
void *workshare_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_parallel_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data of parent task */
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
uint32_t requested_team_size, /* number of threads in team */
|
||||
void *parallel_function, /* pointer to outlined function */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
typedef void (*ompt_end_parallel_callback_t) (
|
||||
ompt_parallel_id_t parallel_id, /* id of parallel region */
|
||||
ompt_task_id_t task_id, /* id of task */
|
||||
ompt_invoker_t invoker /* who invokes master task? */
|
||||
);
|
||||
|
||||
/* tasks */
|
||||
typedef void (*ompt_task_callback_t) (
|
||||
ompt_task_id_t task_id /* id of task */
|
||||
);
|
||||
|
||||
typedef void (*ompt_task_pair_callback_t) (
|
||||
ompt_task_id_t first_task_id,
|
||||
ompt_task_id_t second_task_id
|
||||
);
|
||||
|
||||
typedef void (*ompt_new_task_callback_t) (
|
||||
ompt_task_id_t parent_task_id, /* id of parent task */
|
||||
ompt_frame_t *parent_task_frame, /* frame data for parent task */
|
||||
ompt_task_id_t new_task_id, /* id of created task */
|
||||
void *task_function /* pointer to outlined function */
|
||||
);
|
||||
|
||||
/* task dependences */
|
||||
typedef void (*ompt_task_dependences_callback_t) (
|
||||
ompt_task_id_t task_id, /* ID of task with dependences */
|
||||
const ompt_task_dependence_t *deps,/* vector of task dependences */
|
||||
int ndeps /* number of dependences */
|
||||
);
|
||||
|
||||
/* program */
|
||||
typedef void (*ompt_control_callback_t) (
|
||||
uint64_t command, /* command of control call */
|
||||
uint64_t modifier /* modifier of control call */
|
||||
);
|
||||
|
||||
typedef void (*ompt_callback_t)(void);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* ompt API
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OMPT_API_FNTYPE(fn) fn##_t
|
||||
|
||||
#define OMPT_API_FUNCTION(return_type, fn, args) \
|
||||
typedef return_type (*OMPT_API_FNTYPE(fn)) args
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INQUIRY FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* state */
|
||||
OMPT_API_FUNCTION(ompt_state_t, ompt_get_state, (
|
||||
ompt_wait_id_t *ompt_wait_id
|
||||
));
|
||||
|
||||
/* thread */
|
||||
OMPT_API_FUNCTION(ompt_thread_id_t, ompt_get_thread_id, (void));
|
||||
|
||||
OMPT_API_FUNCTION(void *, ompt_get_idle_frame, (void));
|
||||
|
||||
/* parallel region */
|
||||
OMPT_API_FUNCTION(ompt_parallel_id_t, ompt_get_parallel_id, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_parallel_team_size, (
|
||||
int ancestor_level
|
||||
));
|
||||
|
||||
/* task */
|
||||
OMPT_API_FUNCTION(ompt_task_id_t, ompt_get_task_id, (
|
||||
int depth
|
||||
));
|
||||
|
||||
OMPT_API_FUNCTION(ompt_frame_t *, ompt_get_task_frame, (
|
||||
int depth
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PLACEHOLDERS FOR PERFORMANCE REPORTING
|
||||
***************************************************************************/
|
||||
|
||||
/* idle */
|
||||
OMPT_API_FUNCTION(void, ompt_idle, (
|
||||
void
|
||||
));
|
||||
|
||||
/* overhead */
|
||||
OMPT_API_FUNCTION(void, ompt_overhead, (
|
||||
void
|
||||
));
|
||||
|
||||
/* barrier wait */
|
||||
OMPT_API_FUNCTION(void, ompt_barrier_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* task wait */
|
||||
OMPT_API_FUNCTION(void, ompt_task_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
/* mutex wait */
|
||||
OMPT_API_FUNCTION(void, ompt_mutex_wait, (
|
||||
void
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* INITIALIZATION FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
OMPT_API_FUNCTION(void, ompt_initialize, (
|
||||
ompt_function_lookup_t ompt_fn_lookup,
|
||||
const char *runtime_version,
|
||||
unsigned int ompt_version
|
||||
));
|
||||
|
||||
|
||||
/* initialization interface to be defined by tool */
|
||||
ompt_initialize_t ompt_tool(void);
|
||||
|
||||
typedef enum opt_init_mode_e {
|
||||
ompt_init_mode_never = 0,
|
||||
ompt_init_mode_false = 1,
|
||||
ompt_init_mode_true = 2,
|
||||
ompt_init_mode_always = 3
|
||||
} ompt_init_mode_t;
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_set_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t callback
|
||||
));
|
||||
|
||||
typedef enum ompt_set_callback_rc_e { /* non-standard */
|
||||
ompt_set_callback_error = 0,
|
||||
ompt_has_event_no_callback = 1,
|
||||
ompt_no_event_no_callback = 2,
|
||||
ompt_has_event_may_callback = 3,
|
||||
ompt_has_event_must_callback = 4,
|
||||
} ompt_set_callback_rc_t;
|
||||
|
||||
|
||||
OMPT_API_FUNCTION(int, ompt_get_callback, (
|
||||
ompt_event_t event,
|
||||
ompt_callback_t *callback
|
||||
));
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* MISCELLANEOUS FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* control */
|
||||
// FIXME: remove workaround for clang
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp declare target
|
||||
#endif
|
||||
void ompt_control(
|
||||
uint64_t command,
|
||||
uint64_t modifier
|
||||
);
|
||||
#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
|
||||
#pragma omp end declare target
|
||||
#endif
|
||||
|
||||
/* state enumeration */
|
||||
OMPT_API_FUNCTION(int, ompt_enumerate_state, (
|
||||
int current_state,
|
||||
int *next_state,
|
||||
const char **next_state_name
|
||||
));
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+2646
-2236
File diff suppressed because it is too large
Load Diff
+4635
-4145
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,839 @@
|
||||
/*
|
||||
* kmp_affinity.h -- header for affinity management
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#ifndef KMP_AFFINITY_H
|
||||
#define KMP_AFFINITY_H
|
||||
|
||||
#include "kmp.h"
|
||||
#include "kmp_os.h"
|
||||
|
||||
#if KMP_AFFINITY_SUPPORTED
|
||||
#if KMP_USE_HWLOC
|
||||
class KMPHwlocAffinity : public KMPAffinity {
|
||||
public:
|
||||
class Mask : public KMPAffinity::Mask {
|
||||
hwloc_cpuset_t mask;
|
||||
|
||||
public:
|
||||
Mask() {
|
||||
mask = hwloc_bitmap_alloc();
|
||||
this->zero();
|
||||
}
|
||||
~Mask() { hwloc_bitmap_free(mask); }
|
||||
void set(int i) override { hwloc_bitmap_set(mask, i); }
|
||||
bool is_set(int i) const override { return hwloc_bitmap_isset(mask, i); }
|
||||
void clear(int i) override { hwloc_bitmap_clr(mask, i); }
|
||||
void zero() override { hwloc_bitmap_zero(mask); }
|
||||
void copy(const KMPAffinity::Mask *src) override {
|
||||
const Mask *convert = static_cast<const Mask *>(src);
|
||||
hwloc_bitmap_copy(mask, convert->mask);
|
||||
}
|
||||
void bitwise_and(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
hwloc_bitmap_and(mask, mask, convert->mask);
|
||||
}
|
||||
void bitwise_or(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
hwloc_bitmap_or(mask, mask, convert->mask);
|
||||
}
|
||||
void bitwise_not() override { hwloc_bitmap_not(mask, mask); }
|
||||
int begin() const override { return hwloc_bitmap_first(mask); }
|
||||
int end() const override { return -1; }
|
||||
int next(int previous) const override {
|
||||
return hwloc_bitmap_next(mask, previous);
|
||||
}
|
||||
int get_system_affinity(bool abort_on_error) override {
|
||||
KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
|
||||
"Illegal get affinity operation when not capable");
|
||||
int retval =
|
||||
hwloc_get_cpubind(__kmp_hwloc_topology, mask, HWLOC_CPUBIND_THREAD);
|
||||
if (retval >= 0) {
|
||||
return 0;
|
||||
}
|
||||
int error = errno;
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(FatalSysError), KMP_ERR(error),
|
||||
__kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
int set_system_affinity(bool abort_on_error) const override {
|
||||
KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
|
||||
"Illegal get affinity operation when not capable");
|
||||
int retval =
|
||||
hwloc_set_cpubind(__kmp_hwloc_topology, mask, HWLOC_CPUBIND_THREAD);
|
||||
if (retval >= 0) {
|
||||
return 0;
|
||||
}
|
||||
int error = errno;
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(FatalSysError), KMP_ERR(error),
|
||||
__kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
int get_proc_group() const override {
|
||||
int i;
|
||||
int group = -1;
|
||||
#if KMP_OS_WINDOWS
|
||||
if (__kmp_num_proc_groups == 1) {
|
||||
return 1;
|
||||
}
|
||||
for (i = 0; i < __kmp_num_proc_groups; i++) {
|
||||
// On windows, the long type is always 32 bits
|
||||
unsigned long first_32_bits = hwloc_bitmap_to_ith_ulong(mask, i * 2);
|
||||
unsigned long second_32_bits =
|
||||
hwloc_bitmap_to_ith_ulong(mask, i * 2 + 1);
|
||||
if (first_32_bits == 0 && second_32_bits == 0) {
|
||||
continue;
|
||||
}
|
||||
if (group >= 0) {
|
||||
return -1;
|
||||
}
|
||||
group = i;
|
||||
}
|
||||
#endif /* KMP_OS_WINDOWS */
|
||||
return group;
|
||||
}
|
||||
};
|
||||
void determine_capable(const char *var) override {
|
||||
const hwloc_topology_support *topology_support;
|
||||
if (__kmp_hwloc_topology == NULL) {
|
||||
if (hwloc_topology_init(&__kmp_hwloc_topology) < 0) {
|
||||
__kmp_hwloc_error = TRUE;
|
||||
if (__kmp_affinity_verbose)
|
||||
KMP_WARNING(AffHwlocErrorOccurred, var, "hwloc_topology_init()");
|
||||
}
|
||||
if (hwloc_topology_load(__kmp_hwloc_topology) < 0) {
|
||||
__kmp_hwloc_error = TRUE;
|
||||
if (__kmp_affinity_verbose)
|
||||
KMP_WARNING(AffHwlocErrorOccurred, var, "hwloc_topology_load()");
|
||||
}
|
||||
}
|
||||
topology_support = hwloc_topology_get_support(__kmp_hwloc_topology);
|
||||
// Is the system capable of setting/getting this thread's affinity?
|
||||
// Also, is topology discovery possible? (pu indicates ability to discover
|
||||
// processing units). And finally, were there no errors when calling any
|
||||
// hwloc_* API functions?
|
||||
if (topology_support && topology_support->cpubind->set_thisthread_cpubind &&
|
||||
topology_support->cpubind->get_thisthread_cpubind &&
|
||||
topology_support->discovery->pu && !__kmp_hwloc_error) {
|
||||
// enables affinity according to KMP_AFFINITY_CAPABLE() macro
|
||||
KMP_AFFINITY_ENABLE(TRUE);
|
||||
} else {
|
||||
// indicate that hwloc didn't work and disable affinity
|
||||
__kmp_hwloc_error = TRUE;
|
||||
KMP_AFFINITY_DISABLE();
|
||||
}
|
||||
}
|
||||
void bind_thread(int which) override {
|
||||
KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
|
||||
"Illegal set affinity operation when not capable");
|
||||
KMPAffinity::Mask *mask;
|
||||
KMP_CPU_ALLOC_ON_STACK(mask);
|
||||
KMP_CPU_ZERO(mask);
|
||||
KMP_CPU_SET(which, mask);
|
||||
__kmp_set_system_affinity(mask, TRUE);
|
||||
KMP_CPU_FREE_FROM_STACK(mask);
|
||||
}
|
||||
KMPAffinity::Mask *allocate_mask() override { return new Mask(); }
|
||||
void deallocate_mask(KMPAffinity::Mask *m) override { delete m; }
|
||||
KMPAffinity::Mask *allocate_mask_array(int num) override {
|
||||
return new Mask[num];
|
||||
}
|
||||
void deallocate_mask_array(KMPAffinity::Mask *array) override {
|
||||
Mask *hwloc_array = static_cast<Mask *>(array);
|
||||
delete[] hwloc_array;
|
||||
}
|
||||
KMPAffinity::Mask *index_mask_array(KMPAffinity::Mask *array,
|
||||
int index) override {
|
||||
Mask *hwloc_array = static_cast<Mask *>(array);
|
||||
return &(hwloc_array[index]);
|
||||
}
|
||||
api_type get_api_type() const override { return HWLOC; }
|
||||
};
|
||||
#endif /* KMP_USE_HWLOC */
|
||||
|
||||
#if KMP_OS_LINUX
|
||||
/* On some of the older OS's that we build on, these constants aren't present
|
||||
in <asm/unistd.h> #included from <sys.syscall.h>. They must be the same on
|
||||
all systems of the same arch where they are defined, and they cannot change.
|
||||
stone forever. */
|
||||
#include <sys/syscall.h>
|
||||
#if KMP_ARCH_X86 || KMP_ARCH_ARM
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 241
|
||||
#elif __NR_sched_setaffinity != 241
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 242
|
||||
#elif __NR_sched_getaffinity != 242
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#elif KMP_ARCH_AARCH64
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 122
|
||||
#elif __NR_sched_setaffinity != 122
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 123
|
||||
#elif __NR_sched_getaffinity != 123
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#elif KMP_ARCH_X86_64
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 203
|
||||
#elif __NR_sched_setaffinity != 203
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 204
|
||||
#elif __NR_sched_getaffinity != 204
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#elif KMP_ARCH_PPC64
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 222
|
||||
#elif __NR_sched_setaffinity != 222
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 223
|
||||
#elif __NR_sched_getaffinity != 223
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#elif KMP_ARCH_MIPS
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 4239
|
||||
#elif __NR_sched_setaffinity != 4239
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 4240
|
||||
#elif __NR_sched_getaffinity != 4240
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#elif KMP_ARCH_MIPS64
|
||||
#ifndef __NR_sched_setaffinity
|
||||
#define __NR_sched_setaffinity 5195
|
||||
#elif __NR_sched_setaffinity != 5195
|
||||
#error Wrong code for setaffinity system call.
|
||||
#endif /* __NR_sched_setaffinity */
|
||||
#ifndef __NR_sched_getaffinity
|
||||
#define __NR_sched_getaffinity 5196
|
||||
#elif __NR_sched_getaffinity != 5196
|
||||
#error Wrong code for getaffinity system call.
|
||||
#endif /* __NR_sched_getaffinity */
|
||||
#error Unknown or unsupported architecture
|
||||
#endif /* KMP_ARCH_* */
|
||||
class KMPNativeAffinity : public KMPAffinity {
|
||||
class Mask : public KMPAffinity::Mask {
|
||||
typedef unsigned char mask_t;
|
||||
static const int BITS_PER_MASK_T = sizeof(mask_t) * CHAR_BIT;
|
||||
|
||||
public:
|
||||
mask_t *mask;
|
||||
Mask() { mask = (mask_t *)__kmp_allocate(__kmp_affin_mask_size); }
|
||||
~Mask() {
|
||||
if (mask)
|
||||
__kmp_free(mask);
|
||||
}
|
||||
void set(int i) override {
|
||||
mask[i / BITS_PER_MASK_T] |= ((mask_t)1 << (i % BITS_PER_MASK_T));
|
||||
}
|
||||
bool is_set(int i) const override {
|
||||
return (mask[i / BITS_PER_MASK_T] & ((mask_t)1 << (i % BITS_PER_MASK_T)));
|
||||
}
|
||||
void clear(int i) override {
|
||||
mask[i / BITS_PER_MASK_T] &= ~((mask_t)1 << (i % BITS_PER_MASK_T));
|
||||
}
|
||||
void zero() override {
|
||||
for (size_t i = 0; i < __kmp_affin_mask_size; ++i)
|
||||
mask[i] = 0;
|
||||
}
|
||||
void copy(const KMPAffinity::Mask *src) override {
|
||||
const Mask *convert = static_cast<const Mask *>(src);
|
||||
for (size_t i = 0; i < __kmp_affin_mask_size; ++i)
|
||||
mask[i] = convert->mask[i];
|
||||
}
|
||||
void bitwise_and(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
for (size_t i = 0; i < __kmp_affin_mask_size; ++i)
|
||||
mask[i] &= convert->mask[i];
|
||||
}
|
||||
void bitwise_or(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
for (size_t i = 0; i < __kmp_affin_mask_size; ++i)
|
||||
mask[i] |= convert->mask[i];
|
||||
}
|
||||
void bitwise_not() override {
|
||||
for (size_t i = 0; i < __kmp_affin_mask_size; ++i)
|
||||
mask[i] = ~(mask[i]);
|
||||
}
|
||||
int begin() const override {
|
||||
int retval = 0;
|
||||
while (retval < end() && !is_set(retval))
|
||||
++retval;
|
||||
return retval;
|
||||
}
|
||||
int end() const override { return __kmp_affin_mask_size * BITS_PER_MASK_T; }
|
||||
int next(int previous) const override {
|
||||
int retval = previous + 1;
|
||||
while (retval < end() && !is_set(retval))
|
||||
++retval;
|
||||
return retval;
|
||||
}
|
||||
int get_system_affinity(bool abort_on_error) override {
|
||||
KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
|
||||
"Illegal get affinity operation when not capable");
|
||||
int retval =
|
||||
syscall(__NR_sched_getaffinity, 0, __kmp_affin_mask_size, mask);
|
||||
if (retval >= 0) {
|
||||
return 0;
|
||||
}
|
||||
int error = errno;
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(FatalSysError), KMP_ERR(error),
|
||||
__kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
int set_system_affinity(bool abort_on_error) const override {
|
||||
KMP_ASSERT2(KMP_AFFINITY_CAPABLE(),
|
||||
"Illegal get affinity operation when not capable");
|
||||
int retval =
|
||||
syscall(__NR_sched_setaffinity, 0, __kmp_affin_mask_size, mask);
|
||||
if (retval >= 0) {
|
||||
return 0;
|
||||
}
|
||||
int error = errno;
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(FatalSysError), KMP_ERR(error),
|
||||
__kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
};
|
||||
void determine_capable(const char *env_var) override {
|
||||
__kmp_affinity_determine_capable(env_var);
|
||||
}
|
||||
void bind_thread(int which) override { __kmp_affinity_bind_thread(which); }
|
||||
KMPAffinity::Mask *allocate_mask() override {
|
||||
KMPNativeAffinity::Mask *retval = new Mask();
|
||||
return retval;
|
||||
}
|
||||
void deallocate_mask(KMPAffinity::Mask *m) override {
|
||||
KMPNativeAffinity::Mask *native_mask =
|
||||
static_cast<KMPNativeAffinity::Mask *>(m);
|
||||
delete m;
|
||||
}
|
||||
KMPAffinity::Mask *allocate_mask_array(int num) override {
|
||||
return new Mask[num];
|
||||
}
|
||||
void deallocate_mask_array(KMPAffinity::Mask *array) override {
|
||||
Mask *linux_array = static_cast<Mask *>(array);
|
||||
delete[] linux_array;
|
||||
}
|
||||
KMPAffinity::Mask *index_mask_array(KMPAffinity::Mask *array,
|
||||
int index) override {
|
||||
Mask *linux_array = static_cast<Mask *>(array);
|
||||
return &(linux_array[index]);
|
||||
}
|
||||
api_type get_api_type() const override { return NATIVE_OS; }
|
||||
};
|
||||
#endif /* KMP_OS_LINUX */
|
||||
|
||||
#if KMP_OS_WINDOWS
|
||||
class KMPNativeAffinity : public KMPAffinity {
|
||||
class Mask : public KMPAffinity::Mask {
|
||||
typedef ULONG_PTR mask_t;
|
||||
static const int BITS_PER_MASK_T = sizeof(mask_t) * CHAR_BIT;
|
||||
mask_t *mask;
|
||||
|
||||
public:
|
||||
Mask() {
|
||||
mask = (mask_t *)__kmp_allocate(sizeof(mask_t) * __kmp_num_proc_groups);
|
||||
}
|
||||
~Mask() {
|
||||
if (mask)
|
||||
__kmp_free(mask);
|
||||
}
|
||||
void set(int i) override {
|
||||
mask[i / BITS_PER_MASK_T] |= ((mask_t)1 << (i % BITS_PER_MASK_T));
|
||||
}
|
||||
bool is_set(int i) const override {
|
||||
return (mask[i / BITS_PER_MASK_T] & ((mask_t)1 << (i % BITS_PER_MASK_T)));
|
||||
}
|
||||
void clear(int i) override {
|
||||
mask[i / BITS_PER_MASK_T] &= ~((mask_t)1 << (i % BITS_PER_MASK_T));
|
||||
}
|
||||
void zero() override {
|
||||
for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
|
||||
mask[i] = 0;
|
||||
}
|
||||
void copy(const KMPAffinity::Mask *src) override {
|
||||
const Mask *convert = static_cast<const Mask *>(src);
|
||||
for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
|
||||
mask[i] = convert->mask[i];
|
||||
}
|
||||
void bitwise_and(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
|
||||
mask[i] &= convert->mask[i];
|
||||
}
|
||||
void bitwise_or(const KMPAffinity::Mask *rhs) override {
|
||||
const Mask *convert = static_cast<const Mask *>(rhs);
|
||||
for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
|
||||
mask[i] |= convert->mask[i];
|
||||
}
|
||||
void bitwise_not() override {
|
||||
for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
|
||||
mask[i] = ~(mask[i]);
|
||||
}
|
||||
int begin() const override {
|
||||
int retval = 0;
|
||||
while (retval < end() && !is_set(retval))
|
||||
++retval;
|
||||
return retval;
|
||||
}
|
||||
int end() const override { return __kmp_num_proc_groups * BITS_PER_MASK_T; }
|
||||
int next(int previous) const override {
|
||||
int retval = previous + 1;
|
||||
while (retval < end() && !is_set(retval))
|
||||
++retval;
|
||||
return retval;
|
||||
}
|
||||
int set_system_affinity(bool abort_on_error) const override {
|
||||
if (__kmp_num_proc_groups > 1) {
|
||||
// Check for a valid mask.
|
||||
GROUP_AFFINITY ga;
|
||||
int group = get_proc_group();
|
||||
if (group < 0) {
|
||||
if (abort_on_error) {
|
||||
KMP_FATAL(AffinityInvalidMask, "kmp_set_affinity");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// Transform the bit vector into a GROUP_AFFINITY struct
|
||||
// and make the system call to set affinity.
|
||||
ga.Group = group;
|
||||
ga.Mask = mask[group];
|
||||
ga.Reserved[0] = ga.Reserved[1] = ga.Reserved[2] = 0;
|
||||
|
||||
KMP_DEBUG_ASSERT(__kmp_SetThreadGroupAffinity != NULL);
|
||||
if (__kmp_SetThreadGroupAffinity(GetCurrentThread(), &ga, NULL) == 0) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(CantSetThreadAffMask),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
} else {
|
||||
if (!SetThreadAffinityMask(GetCurrentThread(), *mask)) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal, KMP_MSG(CantSetThreadAffMask),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int get_system_affinity(bool abort_on_error) override {
|
||||
if (__kmp_num_proc_groups > 1) {
|
||||
this->zero();
|
||||
GROUP_AFFINITY ga;
|
||||
KMP_DEBUG_ASSERT(__kmp_GetThreadGroupAffinity != NULL);
|
||||
if (__kmp_GetThreadGroupAffinity(GetCurrentThread(), &ga) == 0) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal,
|
||||
KMP_MSG(FunctionError, "GetThreadGroupAffinity()"),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
if ((ga.Group < 0) || (ga.Group > __kmp_num_proc_groups) ||
|
||||
(ga.Mask == 0)) {
|
||||
return -1;
|
||||
}
|
||||
mask[ga.Group] = ga.Mask;
|
||||
} else {
|
||||
mask_t newMask, sysMask, retval;
|
||||
if (!GetProcessAffinityMask(GetCurrentProcess(), &newMask, &sysMask)) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal,
|
||||
KMP_MSG(FunctionError, "GetProcessAffinityMask()"),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
retval = SetThreadAffinityMask(GetCurrentThread(), newMask);
|
||||
if (!retval) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal,
|
||||
KMP_MSG(FunctionError, "SetThreadAffinityMask()"),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
newMask = SetThreadAffinityMask(GetCurrentThread(), retval);
|
||||
if (!newMask) {
|
||||
DWORD error = GetLastError();
|
||||
if (abort_on_error) {
|
||||
__kmp_msg(kmp_ms_fatal,
|
||||
KMP_MSG(FunctionError, "SetThreadAffinityMask()"),
|
||||
KMP_ERR(error), __kmp_msg_null);
|
||||
}
|
||||
}
|
||||
*mask = retval;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int get_proc_group() const override {
|
||||
int group = -1;
|
||||
if (__kmp_num_proc_groups == 1) {
|
||||
return 1;
|
||||
}
|
||||
for (int i = 0; i < __kmp_num_proc_groups; i++) {
|
||||
if (mask[i] == 0)
|
||||
continue;
|
||||
if (group >= 0)
|
||||
return -1;
|
||||
group = i;
|
||||
}
|
||||
return group;
|
||||
}
|
||||
};
|
||||
void determine_capable(const char *env_var) override {
|
||||
__kmp_affinity_determine_capable(env_var);
|
||||
}
|
||||
void bind_thread(int which) override { __kmp_affinity_bind_thread(which); }
|
||||
KMPAffinity::Mask *allocate_mask() override { return new Mask(); }
|
||||
void deallocate_mask(KMPAffinity::Mask *m) override { delete m; }
|
||||
KMPAffinity::Mask *allocate_mask_array(int num) override {
|
||||
return new Mask[num];
|
||||
}
|
||||
void deallocate_mask_array(KMPAffinity::Mask *array) override {
|
||||
Mask *windows_array = static_cast<Mask *>(array);
|
||||
delete[] windows_array;
|
||||
}
|
||||
KMPAffinity::Mask *index_mask_array(KMPAffinity::Mask *array,
|
||||
int index) override {
|
||||
Mask *windows_array = static_cast<Mask *>(array);
|
||||
return &(windows_array[index]);
|
||||
}
|
||||
api_type get_api_type() const override { return NATIVE_OS; }
|
||||
};
|
||||
#endif /* KMP_OS_WINDOWS */
|
||||
#endif /* KMP_AFFINITY_SUPPORTED */
|
||||
|
||||
class Address {
|
||||
public:
|
||||
static const unsigned maxDepth = 32;
|
||||
unsigned labels[maxDepth];
|
||||
unsigned childNums[maxDepth];
|
||||
unsigned depth;
|
||||
unsigned leader;
|
||||
Address(unsigned _depth) : depth(_depth), leader(FALSE) {}
|
||||
Address &operator=(const Address &b) {
|
||||
depth = b.depth;
|
||||
for (unsigned i = 0; i < depth; i++) {
|
||||
labels[i] = b.labels[i];
|
||||
childNums[i] = b.childNums[i];
|
||||
}
|
||||
leader = FALSE;
|
||||
return *this;
|
||||
}
|
||||
bool operator==(const Address &b) const {
|
||||
if (depth != b.depth)
|
||||
return false;
|
||||
for (unsigned i = 0; i < depth; i++)
|
||||
if (labels[i] != b.labels[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool isClose(const Address &b, int level) const {
|
||||
if (depth != b.depth)
|
||||
return false;
|
||||
if ((unsigned)level >= depth)
|
||||
return true;
|
||||
for (unsigned i = 0; i < (depth - level); i++)
|
||||
if (labels[i] != b.labels[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator!=(const Address &b) const { return !operator==(b); }
|
||||
void print() const {
|
||||
unsigned i;
|
||||
printf("Depth: %u --- ", depth);
|
||||
for (i = 0; i < depth; i++) {
|
||||
printf("%u ", labels[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class AddrUnsPair {
|
||||
public:
|
||||
Address first;
|
||||
unsigned second;
|
||||
AddrUnsPair(Address _first, unsigned _second)
|
||||
: first(_first), second(_second) {}
|
||||
AddrUnsPair &operator=(const AddrUnsPair &b) {
|
||||
first = b.first;
|
||||
second = b.second;
|
||||
return *this;
|
||||
}
|
||||
void print() const {
|
||||
printf("first = ");
|
||||
first.print();
|
||||
printf(" --- second = %u", second);
|
||||
}
|
||||
bool operator==(const AddrUnsPair &b) const {
|
||||
if (first != b.first)
|
||||
return false;
|
||||
if (second != b.second)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool operator!=(const AddrUnsPair &b) const { return !operator==(b); }
|
||||
};
|
||||
|
||||
static int __kmp_affinity_cmp_Address_labels(const void *a, const void *b) {
|
||||
const Address *aa = &(((const AddrUnsPair *)a)->first);
|
||||
const Address *bb = &(((const AddrUnsPair *)b)->first);
|
||||
unsigned depth = aa->depth;
|
||||
unsigned i;
|
||||
KMP_DEBUG_ASSERT(depth == bb->depth);
|
||||
for (i = 0; i < depth; i++) {
|
||||
if (aa->labels[i] < bb->labels[i])
|
||||
return -1;
|
||||
if (aa->labels[i] > bb->labels[i])
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A structure for holding machine-specific hierarchy info to be computed once
|
||||
at init. This structure represents a mapping of threads to the actual machine
|
||||
hierarchy, or to our best guess at what the hierarchy might be, for the
|
||||
purpose of performing an efficient barrier. In the worst case, when there is
|
||||
no machine hierarchy information, it produces a tree suitable for a barrier,
|
||||
similar to the tree used in the hyper barrier. */
|
||||
class hierarchy_info {
|
||||
public:
|
||||
/* Good default values for number of leaves and branching factor, given no
|
||||
affinity information. Behaves a bit like hyper barrier. */
|
||||
static const kmp_uint32 maxLeaves = 4;
|
||||
static const kmp_uint32 minBranch = 4;
|
||||
/** Number of levels in the hierarchy. Typical levels are threads/core,
|
||||
cores/package or socket, packages/node, nodes/machine, etc. We don't want
|
||||
to get specific with nomenclature. When the machine is oversubscribed we
|
||||
add levels to duplicate the hierarchy, doubling the thread capacity of the
|
||||
hierarchy each time we add a level. */
|
||||
kmp_uint32 maxLevels;
|
||||
|
||||
/** This is specifically the depth of the machine configuration hierarchy, in
|
||||
terms of the number of levels along the longest path from root to any
|
||||
leaf. It corresponds to the number of entries in numPerLevel if we exclude
|
||||
all but one trailing 1. */
|
||||
kmp_uint32 depth;
|
||||
kmp_uint32 base_num_threads;
|
||||
enum init_status { initialized = 0, not_initialized = 1, initializing = 2 };
|
||||
volatile kmp_int8 uninitialized; // 0=initialized, 1=not initialized,
|
||||
// 2=initialization in progress
|
||||
volatile kmp_int8 resizing; // 0=not resizing, 1=resizing
|
||||
|
||||
/** Level 0 corresponds to leaves. numPerLevel[i] is the number of children
|
||||
the parent of a node at level i has. For example, if we have a machine
|
||||
with 4 packages, 4 cores/package and 2 HT per core, then numPerLevel =
|
||||
{2, 4, 4, 1, 1}. All empty levels are set to 1. */
|
||||
kmp_uint32 *numPerLevel;
|
||||
kmp_uint32 *skipPerLevel;
|
||||
|
||||
void deriveLevels(AddrUnsPair *adr2os, int num_addrs) {
|
||||
int hier_depth = adr2os[0].first.depth;
|
||||
int level = 0;
|
||||
for (int i = hier_depth - 1; i >= 0; --i) {
|
||||
int max = -1;
|
||||
for (int j = 0; j < num_addrs; ++j) {
|
||||
int next = adr2os[j].first.childNums[i];
|
||||
if (next > max)
|
||||
max = next;
|
||||
}
|
||||
numPerLevel[level] = max + 1;
|
||||
++level;
|
||||
}
|
||||
}
|
||||
|
||||
hierarchy_info()
|
||||
: maxLevels(7), depth(1), uninitialized(not_initialized), resizing(0) {}
|
||||
|
||||
void fini() {
|
||||
if (!uninitialized && numPerLevel) {
|
||||
__kmp_free(numPerLevel);
|
||||
numPerLevel = NULL;
|
||||
uninitialized = not_initialized;
|
||||
}
|
||||
}
|
||||
|
||||
void init(AddrUnsPair *adr2os, int num_addrs) {
|
||||
kmp_int8 bool_result = KMP_COMPARE_AND_STORE_ACQ8(
|
||||
&uninitialized, not_initialized, initializing);
|
||||
if (bool_result == 0) { // Wait for initialization
|
||||
while (TCR_1(uninitialized) != initialized)
|
||||
KMP_CPU_PAUSE();
|
||||
return;
|
||||
}
|
||||
KMP_DEBUG_ASSERT(bool_result == 1);
|
||||
|
||||
/* Added explicit initialization of the data fields here to prevent usage of
|
||||
dirty value observed when static library is re-initialized multiple times
|
||||
(e.g. when non-OpenMP thread repeatedly launches/joins thread that uses
|
||||
OpenMP). */
|
||||
depth = 1;
|
||||
resizing = 0;
|
||||
maxLevels = 7;
|
||||
numPerLevel =
|
||||
(kmp_uint32 *)__kmp_allocate(maxLevels * 2 * sizeof(kmp_uint32));
|
||||
skipPerLevel = &(numPerLevel[maxLevels]);
|
||||
for (kmp_uint32 i = 0; i < maxLevels;
|
||||
++i) { // init numPerLevel[*] to 1 item per level
|
||||
numPerLevel[i] = 1;
|
||||
skipPerLevel[i] = 1;
|
||||
}
|
||||
|
||||
// Sort table by physical ID
|
||||
if (adr2os) {
|
||||
qsort(adr2os, num_addrs, sizeof(*adr2os),
|
||||
__kmp_affinity_cmp_Address_labels);
|
||||
deriveLevels(adr2os, num_addrs);
|
||||
} else {
|
||||
numPerLevel[0] = maxLeaves;
|
||||
numPerLevel[1] = num_addrs / maxLeaves;
|
||||
if (num_addrs % maxLeaves)
|
||||
numPerLevel[1]++;
|
||||
}
|
||||
|
||||
base_num_threads = num_addrs;
|
||||
for (int i = maxLevels - 1; i >= 0;
|
||||
--i) // count non-empty levels to get depth
|
||||
if (numPerLevel[i] != 1 || depth > 1) // only count one top-level '1'
|
||||
depth++;
|
||||
|
||||
kmp_uint32 branch = minBranch;
|
||||
if (numPerLevel[0] == 1)
|
||||
branch = num_addrs / maxLeaves;
|
||||
if (branch < minBranch)
|
||||
branch = minBranch;
|
||||
for (kmp_uint32 d = 0; d < depth - 1; ++d) { // optimize hierarchy width
|
||||
while (numPerLevel[d] > branch ||
|
||||
(d == 0 && numPerLevel[d] > maxLeaves)) { // max 4 on level 0!
|
||||
if (numPerLevel[d] & 1)
|
||||
numPerLevel[d]++;
|
||||
numPerLevel[d] = numPerLevel[d] >> 1;
|
||||
if (numPerLevel[d + 1] == 1)
|
||||
depth++;
|
||||
numPerLevel[d + 1] = numPerLevel[d + 1] << 1;
|
||||
}
|
||||
if (numPerLevel[0] == 1) {
|
||||
branch = branch >> 1;
|
||||
if (branch < 4)
|
||||
branch = minBranch;
|
||||
}
|
||||
}
|
||||
|
||||
for (kmp_uint32 i = 1; i < depth; ++i)
|
||||
skipPerLevel[i] = numPerLevel[i - 1] * skipPerLevel[i - 1];
|
||||
// Fill in hierarchy in the case of oversubscription
|
||||
for (kmp_uint32 i = depth; i < maxLevels; ++i)
|
||||
skipPerLevel[i] = 2 * skipPerLevel[i - 1];
|
||||
|
||||
uninitialized = initialized; // One writer
|
||||
}
|
||||
|
||||
// Resize the hierarchy if nproc changes to something larger than before
|
||||
void resize(kmp_uint32 nproc) {
|
||||
kmp_int8 bool_result = KMP_COMPARE_AND_STORE_ACQ8(&resizing, 0, 1);
|
||||
while (bool_result == 0) { // someone else is trying to resize
|
||||
KMP_CPU_PAUSE();
|
||||
if (nproc <= base_num_threads) // happy with other thread's resize
|
||||
return;
|
||||
else // try to resize
|
||||
bool_result = KMP_COMPARE_AND_STORE_ACQ8(&resizing, 0, 1);
|
||||
}
|
||||
KMP_DEBUG_ASSERT(bool_result != 0);
|
||||
if (nproc <= base_num_threads)
|
||||
return; // happy with other thread's resize
|
||||
|
||||
// Calculate new maxLevels
|
||||
kmp_uint32 old_sz = skipPerLevel[depth - 1];
|
||||
kmp_uint32 incs = 0, old_maxLevels = maxLevels;
|
||||
// First see if old maxLevels is enough to contain new size
|
||||
for (kmp_uint32 i = depth; i < maxLevels && nproc > old_sz; ++i) {
|
||||
skipPerLevel[i] = 2 * skipPerLevel[i - 1];
|
||||
numPerLevel[i - 1] *= 2;
|
||||
old_sz *= 2;
|
||||
depth++;
|
||||
}
|
||||
if (nproc > old_sz) { // Not enough space, need to expand hierarchy
|
||||
while (nproc > old_sz) {
|
||||
old_sz *= 2;
|
||||
incs++;
|
||||
depth++;
|
||||
}
|
||||
maxLevels += incs;
|
||||
|
||||
// Resize arrays
|
||||
kmp_uint32 *old_numPerLevel = numPerLevel;
|
||||
kmp_uint32 *old_skipPerLevel = skipPerLevel;
|
||||
numPerLevel = skipPerLevel = NULL;
|
||||
numPerLevel =
|
||||
(kmp_uint32 *)__kmp_allocate(maxLevels * 2 * sizeof(kmp_uint32));
|
||||
skipPerLevel = &(numPerLevel[maxLevels]);
|
||||
|
||||
// Copy old elements from old arrays
|
||||
for (kmp_uint32 i = 0; i < old_maxLevels;
|
||||
++i) { // init numPerLevel[*] to 1 item per level
|
||||
numPerLevel[i] = old_numPerLevel[i];
|
||||
skipPerLevel[i] = old_skipPerLevel[i];
|
||||
}
|
||||
|
||||
// Init new elements in arrays to 1
|
||||
for (kmp_uint32 i = old_maxLevels; i < maxLevels;
|
||||
++i) { // init numPerLevel[*] to 1 item per level
|
||||
numPerLevel[i] = 1;
|
||||
skipPerLevel[i] = 1;
|
||||
}
|
||||
|
||||
// Free old arrays
|
||||
__kmp_free(old_numPerLevel);
|
||||
}
|
||||
|
||||
// Fill in oversubscription levels of hierarchy
|
||||
for (kmp_uint32 i = old_maxLevels; i < maxLevels; ++i)
|
||||
skipPerLevel[i] = 2 * skipPerLevel[i - 1];
|
||||
|
||||
base_num_threads = nproc;
|
||||
resizing = 0; // One writer
|
||||
}
|
||||
};
|
||||
#endif // KMP_AFFINITY_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1522
-758
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+201
-201
@@ -22,76 +22,80 @@
|
||||
@param gtid Global thread ID of encountering thread
|
||||
@param cncl_kind Cancellation kind (parallel, for, sections, taskgroup)
|
||||
|
||||
@return returns true if the cancellation request has been activated and the execution thread
|
||||
needs to proceed to the end of the canceled region.
|
||||
@return returns true if the cancellation request has been activated and the
|
||||
execution thread needs to proceed to the end of the canceled region.
|
||||
|
||||
Request cancellation of the binding OpenMP region.
|
||||
*/
|
||||
kmp_int32 __kmpc_cancel(ident_t* loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
|
||||
kmp_info_t *this_thr = __kmp_threads [ gtid ];
|
||||
|
||||
KC_TRACE( 10, ("__kmpc_cancel: T#%d request %d OMP_CANCELLATION=%d\n", gtid, cncl_kind, __kmp_omp_cancellation) );
|
||||
kmp_int32 __kmpc_cancel(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
|
||||
kmp_info_t *this_thr = __kmp_threads[gtid];
|
||||
|
||||
KMP_DEBUG_ASSERT(cncl_kind != cancel_noreq);
|
||||
KMP_DEBUG_ASSERT(cncl_kind == cancel_parallel || cncl_kind == cancel_loop ||
|
||||
cncl_kind == cancel_sections || cncl_kind == cancel_taskgroup);
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
KC_TRACE(10, ("__kmpc_cancel: T#%d request %d OMP_CANCELLATION=%d\n", gtid,
|
||||
cncl_kind, __kmp_omp_cancellation));
|
||||
|
||||
if (__kmp_omp_cancellation) {
|
||||
switch (cncl_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the team structure
|
||||
{
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
KMP_DEBUG_ASSERT(this_team);
|
||||
kmp_int32 old = KMP_COMPARE_AND_STORE_RET32(&(this_team->t.t_cancel_request), cancel_noreq, cncl_kind);
|
||||
if (old == cancel_noreq || old == cncl_kind) {
|
||||
//printf("__kmpc_cancel: this_team->t.t_cancel_request=%d @ %p\n",
|
||||
// this_team->t.t_cancel_request, &(this_team->t.t_cancel_request));
|
||||
// we do not have a cancellation request in this team or we do have one
|
||||
// that matches the current request -> cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cancel_taskgroup:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the taskgroup structure
|
||||
{
|
||||
kmp_taskdata_t* task;
|
||||
kmp_taskgroup_t* taskgroup;
|
||||
|
||||
task = this_thr->th.th_current_task;
|
||||
KMP_DEBUG_ASSERT( task );
|
||||
|
||||
taskgroup = task->td_taskgroup;
|
||||
if (taskgroup) {
|
||||
kmp_int32 old = KMP_COMPARE_AND_STORE_RET32(&(taskgroup->cancel_request), cancel_noreq, cncl_kind);
|
||||
if (old == cancel_noreq || old == cncl_kind) {
|
||||
// we do not have a cancellation request in this taskgroup or we do have one
|
||||
// that matches the current request -> cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// TODO: what needs to happen here?
|
||||
// the specification disallows cancellation w/o taskgroups
|
||||
// so we might do anything here, let's abort for now
|
||||
KMP_ASSERT( 0 /* false */);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
KMP_ASSERT (0 /* false */);
|
||||
KMP_DEBUG_ASSERT(cncl_kind != cancel_noreq);
|
||||
KMP_DEBUG_ASSERT(cncl_kind == cancel_parallel || cncl_kind == cancel_loop ||
|
||||
cncl_kind == cancel_sections ||
|
||||
cncl_kind == cancel_taskgroup);
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
|
||||
if (__kmp_omp_cancellation) {
|
||||
switch (cncl_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the team structure
|
||||
{
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
KMP_DEBUG_ASSERT(this_team);
|
||||
kmp_int32 old = KMP_COMPARE_AND_STORE_RET32(
|
||||
&(this_team->t.t_cancel_request), cancel_noreq, cncl_kind);
|
||||
if (old == cancel_noreq || old == cncl_kind) {
|
||||
// printf("__kmpc_cancel: this_team->t.t_cancel_request=%d @ %p\n",
|
||||
// this_team->t.t_cancel_request,
|
||||
// &(this_team->t.t_cancel_request));
|
||||
// we do not have a cancellation request in this team or we do have
|
||||
// one that matches the current request -> cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cancel_taskgroup:
|
||||
// cancellation requests for a task group
|
||||
// are handled through the taskgroup structure
|
||||
{
|
||||
kmp_taskdata_t *task;
|
||||
kmp_taskgroup_t *taskgroup;
|
||||
|
||||
// ICV OMP_CANCELLATION=false, so we ignored this cancel request
|
||||
KMP_DEBUG_ASSERT(!__kmp_omp_cancellation);
|
||||
return 0 /* false */;
|
||||
task = this_thr->th.th_current_task;
|
||||
KMP_DEBUG_ASSERT(task);
|
||||
|
||||
taskgroup = task->td_taskgroup;
|
||||
if (taskgroup) {
|
||||
kmp_int32 old = KMP_COMPARE_AND_STORE_RET32(
|
||||
&(taskgroup->cancel_request), cancel_noreq, cncl_kind);
|
||||
if (old == cancel_noreq || old == cncl_kind) {
|
||||
// we do not have a cancellation request in this taskgroup or we do
|
||||
// have one that matches the current request -> cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
} else {
|
||||
// TODO: what needs to happen here?
|
||||
// the specification disallows cancellation w/o taskgroups
|
||||
// so we might do anything here, let's abort for now
|
||||
KMP_ASSERT(0 /* false */);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
KMP_ASSERT(0 /* false */);
|
||||
}
|
||||
}
|
||||
|
||||
// ICV OMP_CANCELLATION=false, so we ignored this cancel request
|
||||
KMP_DEBUG_ASSERT(!__kmp_omp_cancellation);
|
||||
return 0 /* false */;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -100,77 +104,77 @@ kmp_int32 __kmpc_cancel(ident_t* loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
|
||||
@param gtid Global thread ID of encountering thread
|
||||
@param cncl_kind Cancellation kind (parallel, for, sections, taskgroup)
|
||||
|
||||
@return returns true if a matching cancellation request has been flagged in the RTL and the
|
||||
encountering thread has to cancel..
|
||||
@return returns true if a matching cancellation request has been flagged in the
|
||||
RTL and the encountering thread has to cancel..
|
||||
|
||||
Cancellation point for the encountering thread.
|
||||
*/
|
||||
kmp_int32 __kmpc_cancellationpoint(ident_t* loc_ref, kmp_int32 gtid, kmp_int32 cncl_kind) {
|
||||
kmp_info_t *this_thr = __kmp_threads [ gtid ];
|
||||
kmp_int32 __kmpc_cancellationpoint(ident_t *loc_ref, kmp_int32 gtid,
|
||||
kmp_int32 cncl_kind) {
|
||||
kmp_info_t *this_thr = __kmp_threads[gtid];
|
||||
|
||||
KC_TRACE( 10, ("__kmpc_cancellationpoint: T#%d request %d OMP_CANCELLATION=%d\n", gtid, cncl_kind, __kmp_omp_cancellation) );
|
||||
KC_TRACE(10,
|
||||
("__kmpc_cancellationpoint: T#%d request %d OMP_CANCELLATION=%d\n",
|
||||
gtid, cncl_kind, __kmp_omp_cancellation));
|
||||
|
||||
KMP_DEBUG_ASSERT(cncl_kind != cancel_noreq);
|
||||
KMP_DEBUG_ASSERT(cncl_kind == cancel_parallel || cncl_kind == cancel_loop ||
|
||||
cncl_kind == cancel_sections || cncl_kind == cancel_taskgroup);
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
KMP_DEBUG_ASSERT(cncl_kind != cancel_noreq);
|
||||
KMP_DEBUG_ASSERT(cncl_kind == cancel_parallel || cncl_kind == cancel_loop ||
|
||||
cncl_kind == cancel_sections ||
|
||||
cncl_kind == cancel_taskgroup);
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
|
||||
if (__kmp_omp_cancellation) {
|
||||
switch (cncl_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the team structure
|
||||
{
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
KMP_DEBUG_ASSERT(this_team);
|
||||
if (this_team->t.t_cancel_request) {
|
||||
if (cncl_kind == this_team->t.t_cancel_request) {
|
||||
// the request in the team structure matches the type of
|
||||
// cancellation point so we can cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
KMP_ASSERT( 0 /* false */);
|
||||
}
|
||||
else {
|
||||
// we do not have a cancellation request pending, so we just
|
||||
// ignore this cancellation point
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cancel_taskgroup:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the taskgroup structure
|
||||
{
|
||||
kmp_taskdata_t* task;
|
||||
kmp_taskgroup_t* taskgroup;
|
||||
|
||||
task = this_thr->th.th_current_task;
|
||||
KMP_DEBUG_ASSERT( task );
|
||||
|
||||
taskgroup = task->td_taskgroup;
|
||||
if (taskgroup) {
|
||||
// return the current status of cancellation for the
|
||||
// taskgroup
|
||||
return !!taskgroup->cancel_request;
|
||||
}
|
||||
else {
|
||||
// if a cancellation point is encountered by a task
|
||||
// that does not belong to a taskgroup, it is OK
|
||||
// to ignore it
|
||||
return 0 /* false */;
|
||||
}
|
||||
}
|
||||
default:
|
||||
KMP_ASSERT (0 /* false */);
|
||||
if (__kmp_omp_cancellation) {
|
||||
switch (cncl_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
// cancellation requests for parallel and worksharing constructs
|
||||
// are handled through the team structure
|
||||
{
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
KMP_DEBUG_ASSERT(this_team);
|
||||
if (this_team->t.t_cancel_request) {
|
||||
if (cncl_kind == this_team->t.t_cancel_request) {
|
||||
// the request in the team structure matches the type of
|
||||
// cancellation point so we can cancel
|
||||
return 1 /* true */;
|
||||
}
|
||||
KMP_ASSERT(0 /* false */);
|
||||
} else {
|
||||
// we do not have a cancellation request pending, so we just
|
||||
// ignore this cancellation point
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cancel_taskgroup:
|
||||
// cancellation requests for a task group
|
||||
// are handled through the taskgroup structure
|
||||
{
|
||||
kmp_taskdata_t *task;
|
||||
kmp_taskgroup_t *taskgroup;
|
||||
|
||||
// ICV OMP_CANCELLATION=false, so we ignore the cancellation point
|
||||
KMP_DEBUG_ASSERT(!__kmp_omp_cancellation);
|
||||
return 0 /* false */;
|
||||
task = this_thr->th.th_current_task;
|
||||
KMP_DEBUG_ASSERT(task);
|
||||
|
||||
taskgroup = task->td_taskgroup;
|
||||
if (taskgroup) {
|
||||
// return the current status of cancellation for the taskgroup
|
||||
return !!taskgroup->cancel_request;
|
||||
} else {
|
||||
// if a cancellation point is encountered by a task that does not
|
||||
// belong to a taskgroup, it is OK to ignore it
|
||||
return 0 /* false */;
|
||||
}
|
||||
}
|
||||
default:
|
||||
KMP_ASSERT(0 /* false */);
|
||||
}
|
||||
}
|
||||
|
||||
// ICV OMP_CANCELLATION=false, so we ignore the cancellation point
|
||||
KMP_DEBUG_ASSERT(!__kmp_omp_cancellation);
|
||||
return 0 /* false */;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -178,63 +182,61 @@ kmp_int32 __kmpc_cancellationpoint(ident_t* loc_ref, kmp_int32 gtid, kmp_int32 c
|
||||
@param loc_ref location of the original task directive
|
||||
@param gtid Global thread ID of encountering thread
|
||||
|
||||
@return returns true if a matching cancellation request has been flagged in the RTL and the
|
||||
encountering thread has to cancel..
|
||||
@return returns true if a matching cancellation request has been flagged in the
|
||||
RTL and the encountering thread has to cancel..
|
||||
|
||||
Barrier with cancellation point to send threads from the barrier to the
|
||||
end of the parallel region. Needs a special code pattern as documented
|
||||
end of the parallel region. Needs a special code pattern as documented
|
||||
in the design document for the cancellation feature.
|
||||
*/
|
||||
kmp_int32
|
||||
__kmpc_cancel_barrier(ident_t *loc, kmp_int32 gtid) {
|
||||
int ret = 0 /* false */;
|
||||
kmp_info_t *this_thr = __kmp_threads [ gtid ];
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
kmp_int32 __kmpc_cancel_barrier(ident_t *loc, kmp_int32 gtid) {
|
||||
int ret = 0 /* false */;
|
||||
kmp_info_t *this_thr = __kmp_threads[gtid];
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
KMP_DEBUG_ASSERT(__kmp_get_gtid() == gtid);
|
||||
|
||||
// call into the standard barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
// call into the standard barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
|
||||
// if cancellation is active, check cancellation flag
|
||||
if (__kmp_omp_cancellation) {
|
||||
// depending on which construct to cancel, check the flag and
|
||||
// reset the flag
|
||||
switch (this_team->t.t_cancel_request) {
|
||||
case cancel_parallel:
|
||||
ret = 1;
|
||||
// ensure that threads have checked the flag, when
|
||||
// leaving the above barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
this_team->t.t_cancel_request = cancel_noreq;
|
||||
// the next barrier is the fork/join barrier, which
|
||||
// synchronizes the threads leaving here
|
||||
break;
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
ret = 1;
|
||||
// ensure that threads have checked the flag, when
|
||||
// leaving the above barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
this_team->t.t_cancel_request = cancel_noreq;
|
||||
// synchronize the threads again to make sure we
|
||||
// do not have any run-away threads that cause a race
|
||||
// on the cancellation flag
|
||||
__kmpc_barrier(loc, gtid);
|
||||
break;
|
||||
case cancel_taskgroup:
|
||||
// this case should not occur
|
||||
KMP_ASSERT (0 /* false */ );
|
||||
break;
|
||||
case cancel_noreq:
|
||||
// do nothing
|
||||
break;
|
||||
default:
|
||||
KMP_ASSERT ( 0 /* false */);
|
||||
}
|
||||
// if cancellation is active, check cancellation flag
|
||||
if (__kmp_omp_cancellation) {
|
||||
// depending on which construct to cancel, check the flag and
|
||||
// reset the flag
|
||||
switch (this_team->t.t_cancel_request) {
|
||||
case cancel_parallel:
|
||||
ret = 1;
|
||||
// ensure that threads have checked the flag, when
|
||||
// leaving the above barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
this_team->t.t_cancel_request = cancel_noreq;
|
||||
// the next barrier is the fork/join barrier, which
|
||||
// synchronizes the threads leaving here
|
||||
break;
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
ret = 1;
|
||||
// ensure that threads have checked the flag, when
|
||||
// leaving the above barrier
|
||||
__kmpc_barrier(loc, gtid);
|
||||
this_team->t.t_cancel_request = cancel_noreq;
|
||||
// synchronize the threads again to make sure we do not have any run-away
|
||||
// threads that cause a race on the cancellation flag
|
||||
__kmpc_barrier(loc, gtid);
|
||||
break;
|
||||
case cancel_taskgroup:
|
||||
// this case should not occur
|
||||
KMP_ASSERT(0 /* false */);
|
||||
break;
|
||||
case cancel_noreq:
|
||||
// do nothing
|
||||
break;
|
||||
default:
|
||||
KMP_ASSERT(0 /* false */);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -242,41 +244,39 @@ __kmpc_cancel_barrier(ident_t *loc, kmp_int32 gtid) {
|
||||
@param loc_ref location of the original task directive
|
||||
@param gtid Global thread ID of encountering thread
|
||||
|
||||
@return returns true if a matching cancellation request has been flagged in the RTL and the
|
||||
encountering thread has to cancel..
|
||||
@return returns true if a matching cancellation request has been flagged in the
|
||||
RTL and the encountering thread has to cancel..
|
||||
|
||||
Query function to query the current status of cancellation requests.
|
||||
Can be used to implement the following pattern:
|
||||
|
||||
|
||||
if (kmp_get_cancellation_status(kmp_cancel_parallel)) {
|
||||
perform_cleanup();
|
||||
#pragma omp cancellation point parallel
|
||||
#pragma omp cancellation point parallel
|
||||
}
|
||||
*/
|
||||
int __kmp_get_cancellation_status(int cancel_kind) {
|
||||
if (__kmp_omp_cancellation) {
|
||||
kmp_info_t *this_thr = __kmp_entry_thread();
|
||||
|
||||
switch (cancel_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections:
|
||||
{
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
return this_team->t.t_cancel_request == cancel_kind;
|
||||
}
|
||||
case cancel_taskgroup:
|
||||
{
|
||||
kmp_taskdata_t* task;
|
||||
kmp_taskgroup_t* taskgroup;
|
||||
task = this_thr->th.th_current_task;
|
||||
taskgroup = task->td_taskgroup;
|
||||
return taskgroup && taskgroup->cancel_request;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (__kmp_omp_cancellation) {
|
||||
kmp_info_t *this_thr = __kmp_entry_thread();
|
||||
|
||||
return 0 /* false */;
|
||||
switch (cancel_kind) {
|
||||
case cancel_parallel:
|
||||
case cancel_loop:
|
||||
case cancel_sections: {
|
||||
kmp_team_t *this_team = this_thr->th.th_team;
|
||||
return this_team->t.t_cancel_request == cancel_kind;
|
||||
}
|
||||
case cancel_taskgroup: {
|
||||
kmp_taskdata_t *task;
|
||||
kmp_taskgroup_t *taskgroup;
|
||||
task = this_thr->th.th_current_task;
|
||||
taskgroup = task->td_taskgroup;
|
||||
return taskgroup && taskgroup->cancel_request;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0 /* false */;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* kmp_config.h -- Feature macros
|
||||
*/
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#ifndef KMP_CONFIG_H
|
||||
#define KMP_CONFIG_H
|
||||
|
||||
#include "kmp_platform.h"
|
||||
|
||||
// cmakedefine01 MACRO will define MACRO as either 0 or 1
|
||||
// cmakedefine MACRO 1 will define MACRO as 1 or leave undefined
|
||||
#cmakedefine01 DEBUG_BUILD
|
||||
#cmakedefine01 RELWITHDEBINFO_BUILD
|
||||
#cmakedefine01 LIBOMP_USE_ITT_NOTIFY
|
||||
#define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY
|
||||
#if ! LIBOMP_USE_ITT_NOTIFY
|
||||
# define INTEL_NO_ITTNOTIFY_API
|
||||
#endif
|
||||
#cmakedefine01 LIBOMP_USE_VERSION_SYMBOLS
|
||||
#if LIBOMP_USE_VERSION_SYMBOLS
|
||||
# define KMP_USE_VERSION_SYMBOLS
|
||||
#endif
|
||||
#cmakedefine01 LIBOMP_HAVE_WEAK_ATTRIBUTE
|
||||
#define KMP_HAVE_WEAK_ATTRIBUTE LIBOMP_HAVE_WEAK_ATTRIBUTE
|
||||
#cmakedefine01 LIBOMP_HAVE_PSAPI
|
||||
#define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI
|
||||
#cmakedefine01 LIBOMP_STATS
|
||||
#define KMP_STATS_ENABLED LIBOMP_STATS
|
||||
#cmakedefine01 LIBOMP_HAVE_X86INTRIN_H
|
||||
#define KMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H
|
||||
#cmakedefine01 LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER
|
||||
#define KMP_HAVE___BUILTIN_READCYCLECOUNTER LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER
|
||||
#cmakedefine01 LIBOMP_HAVE___RDTSC
|
||||
#define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC
|
||||
#cmakedefine01 LIBOMP_USE_DEBUGGER
|
||||
#define USE_DEBUGGER LIBOMP_USE_DEBUGGER
|
||||
#cmakedefine01 LIBOMP_OMPT_DEBUG
|
||||
#define OMPT_DEBUG LIBOMP_OMPT_DEBUG
|
||||
#cmakedefine01 LIBOMP_OMPT_SUPPORT
|
||||
#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT
|
||||
#cmakedefine01 LIBOMP_OMPT_BLAME
|
||||
#define OMPT_BLAME LIBOMP_OMPT_BLAME
|
||||
#cmakedefine01 LIBOMP_OMPT_TRACE
|
||||
#define OMPT_TRACE LIBOMP_OMPT_TRACE
|
||||
#cmakedefine01 LIBOMP_USE_ADAPTIVE_LOCKS
|
||||
#define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS
|
||||
#define KMP_DEBUG_ADAPTIVE_LOCKS 0
|
||||
#cmakedefine01 LIBOMP_USE_INTERNODE_ALIGNMENT
|
||||
#define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT
|
||||
#cmakedefine01 LIBOMP_ENABLE_ASSERTIONS
|
||||
#define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS
|
||||
#cmakedefine01 STUBS_LIBRARY
|
||||
#cmakedefine01 LIBOMP_USE_HWLOC
|
||||
#define KMP_USE_HWLOC LIBOMP_USE_HWLOC
|
||||
#define KMP_ARCH_STR "@LIBOMP_LEGAL_ARCH@"
|
||||
#define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@"
|
||||
#define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
|
||||
#define KMP_VERSION_MINOR @LIBOMP_VERSION_MINOR@
|
||||
#define LIBOMP_OMP_VERSION @LIBOMP_OMP_VERSION@
|
||||
#define OMP_50_ENABLED (LIBOMP_OMP_VERSION >= 50)
|
||||
#define OMP_45_ENABLED (LIBOMP_OMP_VERSION >= 45)
|
||||
#define OMP_40_ENABLED (LIBOMP_OMP_VERSION >= 40)
|
||||
#define OMP_30_ENABLED (LIBOMP_OMP_VERSION >= 30)
|
||||
#cmakedefine01 LIBOMP_TSAN_SUPPORT
|
||||
#if LIBOMP_TSAN_SUPPORT
|
||||
#define TSAN_SUPPORT
|
||||
#endif
|
||||
|
||||
// Configured cache line based on architecture
|
||||
#if KMP_ARCH_PPC64
|
||||
# define CACHE_LINE 128
|
||||
#else
|
||||
# define CACHE_LINE 64
|
||||
#endif
|
||||
|
||||
#if ! KMP_32_BIT_ARCH
|
||||
# define BUILD_I8 1
|
||||
#endif
|
||||
|
||||
#define KMP_DYNAMIC_LIB 1
|
||||
#define KMP_NESTED_HOT_TEAMS 1
|
||||
#define KMP_ADJUST_BLOCKTIME 1
|
||||
#define BUILD_PARALLEL_ORDERED 1
|
||||
#define KMP_ASM_INTRINS 1
|
||||
#define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY
|
||||
#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_
|
||||
#if ! KMP_MIC
|
||||
# define USE_LOAD_BALANCE 1
|
||||
#endif
|
||||
#if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN)
|
||||
# define KMP_TDATA_GTID 1
|
||||
#endif
|
||||
#if STUBS_LIBRARY
|
||||
# define KMP_STUB 1
|
||||
#endif
|
||||
#if DEBUG_BUILD || RELWITHDEBINFO_BUILD
|
||||
# define KMP_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if KMP_OS_WINDOWS
|
||||
# define KMP_WIN_CDECL
|
||||
#else
|
||||
# define BUILD_TV
|
||||
# define KMP_GOMP_COMPAT
|
||||
#endif
|
||||
|
||||
#endif // KMP_CONFIG_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* kmp_debug.c -- debug utilities for the Guide library
|
||||
* $Revision: 42150 $
|
||||
* $Date: 2013-03-15 15:40:38 -0500 (Fri, 15 Mar 2013) $
|
||||
*/
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.txt for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
#include "kmp.h"
|
||||
#include "kmp_debug.h" /* really necessary? */
|
||||
#include "kmp_i18n.h"
|
||||
#include "kmp_io.h"
|
||||
|
||||
#ifdef KMP_DEBUG
|
||||
void
|
||||
__kmp_debug_printf_stdout( char const * format, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
|
||||
__kmp_vprintf( kmp_out, format, ap );
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
__kmp_debug_printf( char const * format, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start( ap, format );
|
||||
|
||||
__kmp_vprintf( kmp_err, format, ap );
|
||||
|
||||
va_end( ap );
|
||||
}
|
||||
|
||||
#ifdef KMP_USE_ASSERT
|
||||
int
|
||||
__kmp_debug_assert(
|
||||
char const * msg,
|
||||
char const * file,
|
||||
int line
|
||||
) {
|
||||
|
||||
if ( file == NULL ) {
|
||||
file = KMP_I18N_STR( UnknownFile );
|
||||
} else {
|
||||
// Remove directories from path, leave only file name. File name is enough, there is no need
|
||||
// in bothering developers and customers with full paths.
|
||||
char const * slash = strrchr( file, '/' );
|
||||
if ( slash != NULL ) {
|
||||
file = slash + 1;
|
||||
}; // if
|
||||
}; // if
|
||||
|
||||
#ifdef KMP_DEBUG
|
||||
__kmp_acquire_bootstrap_lock( & __kmp_stdio_lock );
|
||||
__kmp_debug_printf( "Assertion failure at %s(%d): %s.\n", file, line, msg );
|
||||
__kmp_release_bootstrap_lock( & __kmp_stdio_lock );
|
||||
#ifdef USE_ASSERT_BREAK
|
||||
#if KMP_OS_WINDOWS
|
||||
DebugBreak();
|
||||
#endif
|
||||
#endif // USE_ASSERT_BREAK
|
||||
#ifdef USE_ASSERT_STALL
|
||||
/* __kmp_infinite_loop(); */
|
||||
for(;;);
|
||||
#endif // USE_ASSERT_STALL
|
||||
#ifdef USE_ASSERT_SEG
|
||||
{
|
||||
int volatile * ZERO = (int*) 0;
|
||||
++ (*ZERO);
|
||||
}
|
||||
#endif // USE_ASSERT_SEG
|
||||
#endif
|
||||
|
||||
__kmp_msg(
|
||||
kmp_ms_fatal,
|
||||
KMP_MSG( AssertionFailure, file, line ),
|
||||
KMP_HNT( SubmitBugReport ),
|
||||
__kmp_msg_null
|
||||
);
|
||||
|
||||
return 0;
|
||||
|
||||
} // __kmp_debug_assert
|
||||
|
||||
#endif // KMP_USE_ASSERT
|
||||
|
||||
/* Dump debugging buffer to stderr */
|
||||
void
|
||||
__kmp_dump_debug_buffer( void )
|
||||
{
|
||||
if ( __kmp_debug_buffer != NULL ) {
|
||||
int i;
|
||||
int dc = __kmp_debug_count;
|
||||
char *db = & __kmp_debug_buffer[ (dc % __kmp_debug_buf_lines) * __kmp_debug_buf_chars ];
|
||||
char *db_end = & __kmp_debug_buffer[ __kmp_debug_buf_lines * __kmp_debug_buf_chars ];
|
||||
char *db2;
|
||||
|
||||
__kmp_acquire_bootstrap_lock( & __kmp_stdio_lock );
|
||||
__kmp_printf_no_lock( "\nStart dump of debugging buffer (entry=%d):\n",
|
||||
dc % __kmp_debug_buf_lines );
|
||||
|
||||
for ( i = 0; i < __kmp_debug_buf_lines; i++ ) {
|
||||
|
||||
if ( *db != '\0' ) {
|
||||
/* Fix up where no carriage return before string termination char */
|
||||
for ( db2 = db + 1; db2 < db + __kmp_debug_buf_chars - 1; db2 ++) {
|
||||
if ( *db2 == '\0' ) {
|
||||
if ( *(db2-1) != '\n' ) { *db2 = '\n'; *(db2+1) = '\0'; }
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Handle case at end by shortening the printed message by one char if necessary */
|
||||
if ( db2 == db + __kmp_debug_buf_chars - 1 &&
|
||||
*db2 == '\0' && *(db2-1) != '\n' ) {
|
||||
*(db2-1) = '\n';
|
||||
}
|
||||
|
||||
__kmp_printf_no_lock( "%4d: %.*s", i, __kmp_debug_buf_chars, db );
|
||||
*db = '\0'; /* only let it print once! */
|
||||
}
|
||||
|
||||
db += __kmp_debug_buf_chars;
|
||||
if ( db >= db_end )
|
||||
db = __kmp_debug_buffer;
|
||||
}
|
||||
|
||||
__kmp_printf_no_lock( "End dump of debugging buffer (entry=%d).\n\n",
|
||||
( dc+i-1 ) % __kmp_debug_buf_lines );
|
||||
__kmp_release_bootstrap_lock( & __kmp_stdio_lock );
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user