]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/fortran.c
* testsuite/libjava.jvmti/jvmti-interp.exp
[thirdparty/gcc.git] / libgomp / fortran.c
CommitLineData
748086b7 1/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
953ff289
DN
2 Contributed by Jakub Jelinek <jakub@redhat.com>.
3
4 This file is part of the GNU OpenMP Library (libgomp).
5
6 Libgomp is free software; you can redistribute it and/or modify it
748086b7
JJ
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
953ff289
DN
10
11 Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
748086b7 13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
953ff289
DN
14 more details.
15
748086b7
JJ
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
19
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
953ff289
DN
24
25/* This file contains Fortran wrapper routines. */
26
27#include "libgomp.h"
28#include "libgomp_f.h"
29#include <stdlib.h>
30
31#ifdef HAVE_ATTRIBUTE_ALIAS
32/* Use internal aliases if possible. */
a68ab351
JJ
33# define ULP STR1(__USER_LABEL_PREFIX__)
34# define STR1(x) STR2(x)
35# define STR2(x) #x
953ff289 36# define ialias_redirect(fn) \
8887708e 37 extern __typeof (fn) fn __asm__ (ULP "gomp_ialias_" #fn) attribute_hidden;
a68ab351 38# ifndef LIBGOMP_GNU_SYMBOL_VERSIONING
953ff289
DN
39ialias_redirect (omp_init_lock)
40ialias_redirect (omp_init_nest_lock)
41ialias_redirect (omp_destroy_lock)
42ialias_redirect (omp_destroy_nest_lock)
43ialias_redirect (omp_set_lock)
44ialias_redirect (omp_set_nest_lock)
45ialias_redirect (omp_unset_lock)
46ialias_redirect (omp_unset_nest_lock)
47ialias_redirect (omp_test_lock)
48ialias_redirect (omp_test_nest_lock)
a68ab351 49# endif
953ff289
DN
50ialias_redirect (omp_set_dynamic)
51ialias_redirect (omp_set_nested)
52ialias_redirect (omp_set_num_threads)
53ialias_redirect (omp_get_dynamic)
54ialias_redirect (omp_get_nested)
55ialias_redirect (omp_in_parallel)
56ialias_redirect (omp_get_max_threads)
57ialias_redirect (omp_get_num_procs)
58ialias_redirect (omp_get_num_threads)
59ialias_redirect (omp_get_thread_num)
60ialias_redirect (omp_get_wtick)
61ialias_redirect (omp_get_wtime)
a68ab351
JJ
62ialias_redirect (omp_set_schedule)
63ialias_redirect (omp_get_schedule)
64ialias_redirect (omp_get_thread_limit)
65ialias_redirect (omp_set_max_active_levels)
66ialias_redirect (omp_get_max_active_levels)
67ialias_redirect (omp_get_level)
68ialias_redirect (omp_get_ancestor_thread_num)
69ialias_redirect (omp_get_team_size)
70ialias_redirect (omp_get_active_level)
71#endif
72
73#ifndef LIBGOMP_GNU_SYMBOL_VERSIONING
74# define gomp_init_lock__30 omp_init_lock_
75# define gomp_destroy_lock__30 omp_destroy_lock_
76# define gomp_set_lock__30 omp_set_lock_
77# define gomp_unset_lock__30 omp_unset_lock_
78# define gomp_test_lock__30 omp_test_lock_
79# define gomp_init_nest_lock__30 omp_init_nest_lock_
80# define gomp_destroy_nest_lock__30 omp_destroy_nest_lock_
81# define gomp_set_nest_lock__30 omp_set_nest_lock_
82# define gomp_unset_nest_lock__30 omp_unset_nest_lock_
83# define gomp_test_nest_lock__30 omp_test_nest_lock_
84#endif
953ff289
DN
85
86void
a68ab351 87gomp_init_lock__30 (omp_lock_arg_t lock)
953ff289
DN
88{
89#ifndef OMP_LOCK_DIRECT
90 omp_lock_arg (lock) = malloc (sizeof (omp_lock_t));
91#endif
a68ab351 92 gomp_init_lock_30 (omp_lock_arg (lock));
953ff289
DN
93}
94
95void
a68ab351 96gomp_init_nest_lock__30 (omp_nest_lock_arg_t lock)
953ff289
DN
97{
98#ifndef OMP_NEST_LOCK_DIRECT
99 omp_nest_lock_arg (lock) = malloc (sizeof (omp_nest_lock_t));
100#endif
a68ab351 101 gomp_init_nest_lock_30 (omp_nest_lock_arg (lock));
953ff289
DN
102}
103
104void
a68ab351 105gomp_destroy_lock__30 (omp_lock_arg_t lock)
953ff289 106{
a68ab351 107 gomp_destroy_lock_30 (omp_lock_arg (lock));
953ff289
DN
108#ifndef OMP_LOCK_DIRECT
109 free (omp_lock_arg (lock));
110 omp_lock_arg (lock) = NULL;
111#endif
112}
113
114void
a68ab351 115gomp_destroy_nest_lock__30 (omp_nest_lock_arg_t lock)
953ff289 116{
a68ab351 117 gomp_destroy_nest_lock_30 (omp_nest_lock_arg (lock));
953ff289
DN
118#ifndef OMP_NEST_LOCK_DIRECT
119 free (omp_nest_lock_arg (lock));
120 omp_nest_lock_arg (lock) = NULL;
121#endif
122}
123
124void
a68ab351
JJ
125gomp_set_lock__30 (omp_lock_arg_t lock)
126{
127 gomp_set_lock_30 (omp_lock_arg (lock));
128}
129
130void
131gomp_set_nest_lock__30 (omp_nest_lock_arg_t lock)
953ff289 132{
a68ab351 133 gomp_set_nest_lock_30 (omp_nest_lock_arg (lock));
953ff289
DN
134}
135
136void
a68ab351 137gomp_unset_lock__30 (omp_lock_arg_t lock)
953ff289 138{
a68ab351 139 gomp_unset_lock_30 (omp_lock_arg (lock));
953ff289
DN
140}
141
142void
a68ab351
JJ
143gomp_unset_nest_lock__30 (omp_nest_lock_arg_t lock)
144{
145 gomp_unset_nest_lock_30 (omp_nest_lock_arg (lock));
146}
147
148int32_t
149gomp_test_lock__30 (omp_lock_arg_t lock)
150{
151 return gomp_test_lock_30 (omp_lock_arg (lock));
152}
153
154int32_t
155gomp_test_nest_lock__30 (omp_nest_lock_arg_t lock)
953ff289 156{
a68ab351 157 return gomp_test_nest_lock_30 (omp_nest_lock_arg (lock));
953ff289
DN
158}
159
a68ab351 160#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
953ff289 161void
a68ab351 162gomp_init_lock__25 (omp_lock_25_arg_t lock)
953ff289 163{
a68ab351
JJ
164#ifndef OMP_LOCK_25_DIRECT
165 omp_lock_25_arg (lock) = malloc (sizeof (omp_lock_25_t));
166#endif
167 gomp_init_lock_25 (omp_lock_25_arg (lock));
168}
169
170void
171gomp_init_nest_lock__25 (omp_nest_lock_25_arg_t lock)
172{
173#ifndef OMP_NEST_LOCK_25_DIRECT
174 omp_nest_lock_25_arg (lock) = malloc (sizeof (omp_nest_lock_25_t));
175#endif
176 gomp_init_nest_lock_25 (omp_nest_lock_25_arg (lock));
177}
178
179void
180gomp_destroy_lock__25 (omp_lock_25_arg_t lock)
181{
182 gomp_destroy_lock_25 (omp_lock_25_arg (lock));
183#ifndef OMP_LOCK_25_DIRECT
184 free (omp_lock_25_arg (lock));
185 omp_lock_25_arg (lock) = NULL;
186#endif
187}
188
189void
190gomp_destroy_nest_lock__25 (omp_nest_lock_25_arg_t lock)
191{
192 gomp_destroy_nest_lock_25 (omp_nest_lock_25_arg (lock));
193#ifndef OMP_NEST_LOCK_25_DIRECT
194 free (omp_nest_lock_25_arg (lock));
195 omp_nest_lock_25_arg (lock) = NULL;
196#endif
953ff289
DN
197}
198
a68ab351
JJ
199void
200gomp_set_lock__25 (omp_lock_25_arg_t lock)
201{
202 gomp_set_lock_25 (omp_lock_25_arg (lock));
203}
204
205void
206gomp_set_nest_lock__25 (omp_nest_lock_25_arg_t lock)
207{
208 gomp_set_nest_lock_25 (omp_nest_lock_25_arg (lock));
209}
210
211void
212gomp_unset_lock__25 (omp_lock_25_arg_t lock)
213{
214 gomp_unset_lock_25 (omp_lock_25_arg (lock));
215}
216
217void
218gomp_unset_nest_lock__25 (omp_nest_lock_25_arg_t lock)
219{
220 gomp_unset_nest_lock_25 (omp_nest_lock_25_arg (lock));
221}
222
223int32_t
224gomp_test_lock__25 (omp_lock_25_arg_t lock)
225{
226 return gomp_test_lock_25 (omp_lock_25_arg (lock));
227}
228
229int32_t
230gomp_test_nest_lock__25 (omp_nest_lock_25_arg_t lock)
231{
232 return gomp_test_nest_lock_25 (omp_nest_lock_25_arg (lock));
233}
234
235omp_lock_symver (omp_init_lock_)
236omp_lock_symver (omp_destroy_lock_)
237omp_lock_symver (omp_set_lock_)
238omp_lock_symver (omp_unset_lock_)
239omp_lock_symver (omp_test_lock_)
240omp_lock_symver (omp_init_nest_lock_)
241omp_lock_symver (omp_destroy_nest_lock_)
242omp_lock_symver (omp_set_nest_lock_)
243omp_lock_symver (omp_unset_nest_lock_)
244omp_lock_symver (omp_test_nest_lock_)
245#endif
246
953ff289
DN
247void
248omp_set_dynamic_ (const int32_t *set)
249{
250 omp_set_dynamic (*set);
251}
252
253void
254omp_set_dynamic_8_ (const int64_t *set)
255{
256 omp_set_dynamic (*set);
257}
258
259void
260omp_set_nested_ (const int32_t *set)
261{
262 omp_set_nested (*set);
263}
264
265void
266omp_set_nested_8_ (const int64_t *set)
267{
268 omp_set_nested (*set);
269}
270
271void
272omp_set_num_threads_ (const int32_t *set)
273{
274 omp_set_num_threads (*set);
275}
276
277void
278omp_set_num_threads_8_ (const int64_t *set)
279{
280 omp_set_num_threads (*set);
281}
282
283int32_t
284omp_get_dynamic_ (void)
285{
286 return omp_get_dynamic ();
287}
288
289int32_t
290omp_get_nested_ (void)
291{
292 return omp_get_nested ();
293}
294
295int32_t
296omp_in_parallel_ (void)
297{
298 return omp_in_parallel ();
299}
300
953ff289
DN
301int32_t
302omp_get_max_threads_ (void)
303{
304 return omp_get_max_threads ();
305}
306
307int32_t
308omp_get_num_procs_ (void)
309{
310 return omp_get_num_procs ();
311}
312
313int32_t
314omp_get_num_threads_ (void)
315{
316 return omp_get_num_threads ();
317}
318
319int32_t
320omp_get_thread_num_ (void)
321{
322 return omp_get_thread_num ();
323}
324
953ff289
DN
325double
326omp_get_wtick_ (void)
327{
328 return omp_get_wtick ();
329}
330
331double
332omp_get_wtime_ (void)
333{
334 return omp_get_wtime ();
335}
a68ab351
JJ
336
337void
338omp_set_schedule_ (const int32_t *kind, const int32_t *modifier)
339{
340 omp_set_schedule (*kind, *modifier);
341}
342
343void
344omp_set_schedule_8_ (const int32_t *kind, const int64_t *modifier)
345{
346 omp_set_schedule (*kind, *modifier);
347}
348
349void
350omp_get_schedule_ (int32_t *kind, int32_t *modifier)
351{
352 omp_sched_t k;
353 int m;
354 omp_get_schedule (&k, &m);
355 *kind = k;
356 *modifier = m;
357}
358
359void
360omp_get_schedule_8_ (int32_t *kind, int64_t *modifier)
361{
362 omp_sched_t k;
363 int m;
364 omp_get_schedule (&k, &m);
365 *kind = k;
366 *modifier = m;
367}
368
369int32_t
370omp_get_thread_limit_ (void)
371{
372 return omp_get_thread_limit ();
373}
374
375void
376omp_set_max_active_levels_ (const int32_t *levels)
377{
378 omp_set_max_active_levels (*levels);
379}
380
381void
382omp_set_max_active_levels_8_ (const int64_t *levels)
383{
384 omp_set_max_active_levels (*levels);
385}
386
387int32_t
388omp_get_max_active_levels_ (void)
389{
390 return omp_get_max_active_levels ();
391}
392
393int32_t
394omp_get_level_ (void)
395{
396 return omp_get_level ();
397}
398
399int32_t
400omp_get_ancestor_thread_num_ (const int32_t *level)
401{
402 return omp_get_ancestor_thread_num (*level);
403}
404
405int32_t
406omp_get_ancestor_thread_num_8_ (const int64_t *level)
407{
408 return omp_get_ancestor_thread_num (*level);
409}
410
411int32_t
412omp_get_team_size_ (const int32_t *level)
413{
414 return omp_get_team_size (*level);
415}
416
417int32_t
418omp_get_team_size_8_ (const int64_t *level)
419{
420 return omp_get_team_size (*level);
421}
422
423int32_t
424omp_get_active_level_ (void)
425{
426 return omp_get_active_level ();
427}