xref: /dflybsd-src/contrib/gcc-4.7/libgomp/omp.h.in (revision 94b98a915ba84699b2a2adab9146fbc2cf617459)
1*629ff9f7SJohn Marino/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
2*629ff9f7SJohn Marino   Contributed by Richard Henderson <rth@redhat.com>.
3*629ff9f7SJohn Marino
4*629ff9f7SJohn Marino   This file is part of the GNU OpenMP Library (libgomp).
5*629ff9f7SJohn Marino
6*629ff9f7SJohn Marino   Libgomp is free software; you can redistribute it and/or modify it
7*629ff9f7SJohn Marino   under the terms of the GNU General Public License as published by
8*629ff9f7SJohn Marino   the Free Software Foundation; either version 3, or (at your option)
9*629ff9f7SJohn Marino   any later version.
10*629ff9f7SJohn Marino
11*629ff9f7SJohn Marino   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
12*629ff9f7SJohn Marino   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13*629ff9f7SJohn Marino   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14*629ff9f7SJohn Marino   more details.
15*629ff9f7SJohn Marino
16*629ff9f7SJohn Marino   Under Section 7 of GPL version 3, you are granted additional
17*629ff9f7SJohn Marino   permissions described in the GCC Runtime Library Exception, version
18*629ff9f7SJohn Marino   3.1, as published by the Free Software Foundation.
19*629ff9f7SJohn Marino
20*629ff9f7SJohn Marino   You should have received a copy of the GNU General Public License and
21*629ff9f7SJohn Marino   a copy of the GCC Runtime Library Exception along with this program;
22*629ff9f7SJohn Marino   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23*629ff9f7SJohn Marino   <http://www.gnu.org/licenses/>.  */
24*629ff9f7SJohn Marino
25*629ff9f7SJohn Marino#ifndef OMP_H
26*629ff9f7SJohn Marino#define OMP_H 1
27*629ff9f7SJohn Marino
28*629ff9f7SJohn Marino#ifndef _LIBGOMP_OMP_LOCK_DEFINED
29*629ff9f7SJohn Marino#define _LIBGOMP_OMP_LOCK_DEFINED 1
30*629ff9f7SJohn Marino/* These two structures get edited by the libgomp build process to
31*629ff9f7SJohn Marino   reflect the shape of the two types.  Their internals are private
32*629ff9f7SJohn Marino   to the library.  */
33*629ff9f7SJohn Marino
34*629ff9f7SJohn Marinotypedef struct
35*629ff9f7SJohn Marino{
36*629ff9f7SJohn Marino  unsigned char _x[@OMP_LOCK_SIZE@]
37*629ff9f7SJohn Marino    __attribute__((__aligned__(@OMP_LOCK_ALIGN@)));
38*629ff9f7SJohn Marino} omp_lock_t;
39*629ff9f7SJohn Marino
40*629ff9f7SJohn Marinotypedef struct
41*629ff9f7SJohn Marino{
42*629ff9f7SJohn Marino  unsigned char _x[@OMP_NEST_LOCK_SIZE@]
43*629ff9f7SJohn Marino    __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
44*629ff9f7SJohn Marino} omp_nest_lock_t;
45*629ff9f7SJohn Marino#endif
46*629ff9f7SJohn Marino
47*629ff9f7SJohn Marinotypedef enum omp_sched_t
48*629ff9f7SJohn Marino{
49*629ff9f7SJohn Marino  omp_sched_static = 1,
50*629ff9f7SJohn Marino  omp_sched_dynamic = 2,
51*629ff9f7SJohn Marino  omp_sched_guided = 3,
52*629ff9f7SJohn Marino  omp_sched_auto = 4
53*629ff9f7SJohn Marino} omp_sched_t;
54*629ff9f7SJohn Marino
55*629ff9f7SJohn Marino#ifdef __cplusplus
56*629ff9f7SJohn Marinoextern "C" {
57*629ff9f7SJohn Marino# define __GOMP_NOTHROW throw ()
58*629ff9f7SJohn Marino#else
59*629ff9f7SJohn Marino# define __GOMP_NOTHROW __attribute__((__nothrow__))
60*629ff9f7SJohn Marino#endif
61*629ff9f7SJohn Marino
62*629ff9f7SJohn Marinoextern void omp_set_num_threads (int) __GOMP_NOTHROW;
63*629ff9f7SJohn Marinoextern int omp_get_num_threads (void) __GOMP_NOTHROW;
64*629ff9f7SJohn Marinoextern int omp_get_max_threads (void) __GOMP_NOTHROW;
65*629ff9f7SJohn Marinoextern int omp_get_thread_num (void) __GOMP_NOTHROW;
66*629ff9f7SJohn Marinoextern int omp_get_num_procs (void) __GOMP_NOTHROW;
67*629ff9f7SJohn Marino
68*629ff9f7SJohn Marinoextern int omp_in_parallel (void) __GOMP_NOTHROW;
69*629ff9f7SJohn Marino
70*629ff9f7SJohn Marinoextern void omp_set_dynamic (int) __GOMP_NOTHROW;
71*629ff9f7SJohn Marinoextern int omp_get_dynamic (void) __GOMP_NOTHROW;
72*629ff9f7SJohn Marino
73*629ff9f7SJohn Marinoextern void omp_set_nested (int) __GOMP_NOTHROW;
74*629ff9f7SJohn Marinoextern int omp_get_nested (void) __GOMP_NOTHROW;
75*629ff9f7SJohn Marino
76*629ff9f7SJohn Marinoextern void omp_init_lock (omp_lock_t *) __GOMP_NOTHROW;
77*629ff9f7SJohn Marinoextern void omp_destroy_lock (omp_lock_t *) __GOMP_NOTHROW;
78*629ff9f7SJohn Marinoextern void omp_set_lock (omp_lock_t *) __GOMP_NOTHROW;
79*629ff9f7SJohn Marinoextern void omp_unset_lock (omp_lock_t *) __GOMP_NOTHROW;
80*629ff9f7SJohn Marinoextern int omp_test_lock (omp_lock_t *) __GOMP_NOTHROW;
81*629ff9f7SJohn Marino
82*629ff9f7SJohn Marinoextern void omp_init_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
83*629ff9f7SJohn Marinoextern void omp_destroy_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
84*629ff9f7SJohn Marinoextern void omp_set_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
85*629ff9f7SJohn Marinoextern void omp_unset_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
86*629ff9f7SJohn Marinoextern int omp_test_nest_lock (omp_nest_lock_t *) __GOMP_NOTHROW;
87*629ff9f7SJohn Marino
88*629ff9f7SJohn Marinoextern double omp_get_wtime (void) __GOMP_NOTHROW;
89*629ff9f7SJohn Marinoextern double omp_get_wtick (void) __GOMP_NOTHROW;
90*629ff9f7SJohn Marino
91*629ff9f7SJohn Marinovoid omp_set_schedule (omp_sched_t, int) __GOMP_NOTHROW;
92*629ff9f7SJohn Marinovoid omp_get_schedule (omp_sched_t *, int *) __GOMP_NOTHROW;
93*629ff9f7SJohn Marinoint omp_get_thread_limit (void) __GOMP_NOTHROW;
94*629ff9f7SJohn Marinovoid omp_set_max_active_levels (int) __GOMP_NOTHROW;
95*629ff9f7SJohn Marinoint omp_get_max_active_levels (void) __GOMP_NOTHROW;
96*629ff9f7SJohn Marinoint omp_get_level (void) __GOMP_NOTHROW;
97*629ff9f7SJohn Marinoint omp_get_ancestor_thread_num (int) __GOMP_NOTHROW;
98*629ff9f7SJohn Marinoint omp_get_team_size (int) __GOMP_NOTHROW;
99*629ff9f7SJohn Marinoint omp_get_active_level (void) __GOMP_NOTHROW;
100*629ff9f7SJohn Marino
101*629ff9f7SJohn Marinoint omp_in_final (void) __GOMP_NOTHROW;
102*629ff9f7SJohn Marino
103*629ff9f7SJohn Marino#ifdef __cplusplus
104*629ff9f7SJohn Marino}
105*629ff9f7SJohn Marino#endif
106*629ff9f7SJohn Marino
107*629ff9f7SJohn Marino#endif /* OMP_H */
108