svn merge -r 217500:218679 svn+ssh://gcc.gnu.org/svn/gcc/trunk
[official-gcc.git] / libgomp / libgomp.h
blob9a5806534b8e2270955ecc715cd236c00d7d5037
1 /* Copyright (C) 2005-2014 Free Software Foundation, Inc.
2 Contributed by Richard Henderson <rth@redhat.com>.
4 This file is part of the GNU OpenMP Library (libgomp).
6 Libgomp is free software; you can redistribute it and/or modify it
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.
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
13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
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.
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/>. */
25 /* This file contains data types and function declarations that are not
26 part of the official OpenMP user interface. There are declarations
27 in here that are part of the GNU OpenMP ABI, in that the compiler is
28 required to know about them and use them.
30 The convention is that the all caps prefix "GOMP" is used group items
31 that are part of the external ABI, and the lower case prefix "gomp"
32 is used group items that are completely private to the library. */
34 #ifndef LIBGOMP_H
35 #define LIBGOMP_H 1
37 #include "config.h"
38 #include "gstdint.h"
40 #include <pthread.h>
41 #include <stdbool.h>
42 #include <stdlib.h>
43 #include <stdarg.h>
45 #ifdef HAVE_ATTRIBUTE_VISIBILITY
46 # pragma GCC visibility push(hidden)
47 #endif
49 /* If we were a C++ library, we'd get this from <std/atomic>. */
50 enum memmodel
52 MEMMODEL_RELAXED = 0,
53 MEMMODEL_CONSUME = 1,
54 MEMMODEL_ACQUIRE = 2,
55 MEMMODEL_RELEASE = 3,
56 MEMMODEL_ACQ_REL = 4,
57 MEMMODEL_SEQ_CST = 5
60 #include "sem.h"
61 #include "mutex.h"
62 #include "bar.h"
63 #include "ptrlock.h"
66 /* This structure contains the data to control one work-sharing construct,
67 either a LOOP (FOR/DO) or a SECTIONS. */
69 enum gomp_schedule_type
71 GFS_RUNTIME,
72 GFS_STATIC,
73 GFS_DYNAMIC,
74 GFS_GUIDED,
75 GFS_AUTO
78 struct gomp_work_share
80 /* This member records the SCHEDULE clause to be used for this construct.
81 The user specification of "runtime" will already have been resolved.
82 If this is a SECTIONS construct, this value will always be DYNAMIC. */
83 enum gomp_schedule_type sched;
85 int mode;
87 union {
88 struct {
89 /* This is the chunk_size argument to the SCHEDULE clause. */
90 long chunk_size;
92 /* This is the iteration end point. If this is a SECTIONS construct,
93 this is the number of contained sections. */
94 long end;
96 /* This is the iteration step. If this is a SECTIONS construct, this
97 is always 1. */
98 long incr;
101 struct {
102 /* The same as above, but for the unsigned long long loop variants. */
103 unsigned long long chunk_size_ull;
104 unsigned long long end_ull;
105 unsigned long long incr_ull;
109 /* This is a circular queue that details which threads will be allowed
110 into the ordered region and in which order. When a thread allocates
111 iterations on which it is going to work, it also registers itself at
112 the end of the array. When a thread reaches the ordered region, it
113 checks to see if it is the one at the head of the queue. If not, it
114 blocks on its RELEASE semaphore. */
115 unsigned *ordered_team_ids;
117 /* This is the number of threads that have registered themselves in
118 the circular queue ordered_team_ids. */
119 unsigned ordered_num_used;
121 /* This is the team_id of the currently acknowledged owner of the ordered
122 section, or -1u if the ordered section has not been acknowledged by
123 any thread. This is distinguished from the thread that is *allowed*
124 to take the section next. */
125 unsigned ordered_owner;
127 /* This is the index into the circular queue ordered_team_ids of the
128 current thread that's allowed into the ordered reason. */
129 unsigned ordered_cur;
131 /* This is a chain of allocated gomp_work_share blocks, valid only
132 in the first gomp_work_share struct in the block. */
133 struct gomp_work_share *next_alloc;
135 /* The above fields are written once during workshare initialization,
136 or related to ordered worksharing. Make sure the following fields
137 are in a different cache line. */
139 /* This lock protects the update of the following members. */
140 gomp_mutex_t lock __attribute__((aligned (64)));
142 /* This is the count of the number of threads that have exited the work
143 share construct. If the construct was marked nowait, they have moved on
144 to other work; otherwise they're blocked on a barrier. The last member
145 of the team to exit the work share construct must deallocate it. */
146 unsigned threads_completed;
148 union {
149 /* This is the next iteration value to be allocated. In the case of
150 GFS_STATIC loops, this the iteration start point and never changes. */
151 long next;
153 /* The same, but with unsigned long long type. */
154 unsigned long long next_ull;
156 /* This is the returned data structure for SINGLE COPYPRIVATE. */
157 void *copyprivate;
160 union {
161 /* Link to gomp_work_share struct for next work sharing construct
162 encountered after this one. */
163 gomp_ptrlock_t next_ws;
165 /* gomp_work_share structs are chained in the free work share cache
166 through this. */
167 struct gomp_work_share *next_free;
170 /* If only few threads are in the team, ordered_team_ids can point
171 to this array which fills the padding at the end of this struct. */
172 unsigned inline_ordered_team_ids[0];
175 /* This structure contains all of the thread-local data associated with
176 a thread team. This is the data that must be saved when a thread
177 encounters a nested PARALLEL construct. */
179 struct gomp_team_state
181 /* This is the team of which the thread is currently a member. */
182 struct gomp_team *team;
184 /* This is the work share construct which this thread is currently
185 processing. Recall that with NOWAIT, not all threads may be
186 processing the same construct. */
187 struct gomp_work_share *work_share;
189 /* This is the previous work share construct or NULL if there wasn't any.
190 When all threads are done with the current work sharing construct,
191 the previous one can be freed. The current one can't, as its
192 next_ws field is used. */
193 struct gomp_work_share *last_work_share;
195 /* This is the ID of this thread within the team. This value is
196 guaranteed to be between 0 and N-1, where N is the number of
197 threads in the team. */
198 unsigned team_id;
200 /* Nesting level. */
201 unsigned level;
203 /* Active nesting level. Only active parallel regions are counted. */
204 unsigned active_level;
206 /* Place-partition-var, offset and length into gomp_places_list array. */
207 unsigned place_partition_off;
208 unsigned place_partition_len;
210 #ifdef HAVE_SYNC_BUILTINS
211 /* Number of single stmts encountered. */
212 unsigned long single_count;
213 #endif
215 /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the
216 trip number through the loop. So first time a particular loop
217 is encountered this number is 0, the second time through the loop
218 is 1, etc. This is unused when the compiler knows in advance that
219 the loop is statically scheduled. */
220 unsigned long static_trip;
223 struct target_mem_desc;
224 struct gomp_memory_mapping;
226 /* These are the OpenMP 4.0 Internal Control Variables described in
227 section 2.3.1. Those described as having one copy per task are
228 stored within the structure; those described as having one copy
229 for the whole program are (naturally) global variables. */
231 struct gomp_task_icv
233 unsigned long nthreads_var;
234 enum gomp_schedule_type run_sched_var;
235 int run_sched_modifier;
236 int default_device_var;
237 unsigned int thread_limit_var;
238 bool dyn_var;
239 bool nest_var;
240 char bind_var;
241 /* Internal ICV. */
242 struct target_mem_desc *target_data;
245 extern struct gomp_task_icv gomp_global_icv;
246 #ifndef HAVE_SYNC_BUILTINS
247 extern gomp_mutex_t gomp_managed_threads_lock;
248 #endif
249 extern unsigned long gomp_max_active_levels_var;
250 extern bool gomp_cancel_var;
251 extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var;
252 extern unsigned long gomp_available_cpus, gomp_managed_threads;
253 extern unsigned long *gomp_nthreads_var_list, gomp_nthreads_var_list_len;
254 extern char *gomp_bind_var_list;
255 extern unsigned long gomp_bind_var_list_len;
256 extern void **gomp_places_list;
257 extern unsigned long gomp_places_list_len;
259 extern int goacc_notify_var;
260 extern int goacc_device_num;
261 extern char* goacc_device_type;
263 enum gomp_task_kind
265 GOMP_TASK_IMPLICIT,
266 GOMP_TASK_IFFALSE,
267 GOMP_TASK_WAITING,
268 GOMP_TASK_TIED
271 struct gomp_task;
272 struct gomp_taskgroup;
273 struct htab;
275 struct gomp_task_depend_entry
277 void *addr;
278 struct gomp_task_depend_entry *next;
279 struct gomp_task_depend_entry *prev;
280 struct gomp_task *task;
281 bool is_in;
282 bool redundant;
283 bool redundant_out;
286 struct gomp_dependers_vec
288 size_t n_elem;
289 size_t allocated;
290 struct gomp_task *elem[];
293 /* Used when in GOMP_taskwait or in gomp_task_maybe_wait_for_dependencies. */
295 struct gomp_taskwait
297 bool in_taskwait;
298 bool in_depend_wait;
299 size_t n_depend;
300 struct gomp_task *last_parent_depends_on;
301 gomp_sem_t taskwait_sem;
304 /* This structure describes a "task" to be run by a thread. */
306 struct gomp_task
308 struct gomp_task *parent;
309 struct gomp_task *children;
310 struct gomp_task *next_child;
311 struct gomp_task *prev_child;
312 struct gomp_task *next_queue;
313 struct gomp_task *prev_queue;
314 struct gomp_task *next_taskgroup;
315 struct gomp_task *prev_taskgroup;
316 struct gomp_taskgroup *taskgroup;
317 struct gomp_dependers_vec *dependers;
318 struct htab *depend_hash;
319 struct gomp_taskwait *taskwait;
320 size_t depend_count;
321 size_t num_dependees;
322 struct gomp_task_icv icv;
323 void (*fn) (void *);
324 void *fn_data;
325 enum gomp_task_kind kind;
326 bool in_tied_task;
327 bool final_task;
328 bool copy_ctors_done;
329 bool parent_depends_on;
330 struct gomp_task_depend_entry depend[];
333 struct gomp_taskgroup
335 struct gomp_taskgroup *prev;
336 struct gomp_task *children;
337 bool in_taskgroup_wait;
338 bool cancelled;
339 gomp_sem_t taskgroup_sem;
340 size_t num_children;
343 /* This structure describes a "team" of threads. These are the threads
344 that are spawned by a PARALLEL constructs, as well as the work sharing
345 constructs that the team encounters. */
347 struct gomp_team
349 /* This is the number of threads in the current team. */
350 unsigned nthreads;
352 /* This is number of gomp_work_share structs that have been allocated
353 as a block last time. */
354 unsigned work_share_chunk;
356 /* This is the saved team state that applied to a master thread before
357 the current thread was created. */
358 struct gomp_team_state prev_ts;
360 /* This semaphore should be used by the master thread instead of its
361 "native" semaphore in the thread structure. Required for nested
362 parallels, as the master is a member of two teams. */
363 gomp_sem_t master_release;
365 /* This points to an array with pointers to the release semaphore
366 of the threads in the team. */
367 gomp_sem_t **ordered_release;
369 /* List of work shares on which gomp_fini_work_share hasn't been
370 called yet. If the team hasn't been cancelled, this should be
371 equal to each thr->ts.work_share, but otherwise it can be a possibly
372 long list of workshares. */
373 struct gomp_work_share *work_shares_to_free;
375 /* List of gomp_work_share structs chained through next_free fields.
376 This is populated and taken off only by the first thread in the
377 team encountering a new work sharing construct, in a critical
378 section. */
379 struct gomp_work_share *work_share_list_alloc;
381 /* List of gomp_work_share structs freed by free_work_share. New
382 entries are atomically added to the start of the list, and
383 alloc_work_share can safely only move all but the first entry
384 to work_share_list alloc, as free_work_share can happen concurrently
385 with alloc_work_share. */
386 struct gomp_work_share *work_share_list_free;
388 #ifdef HAVE_SYNC_BUILTINS
389 /* Number of simple single regions encountered by threads in this
390 team. */
391 unsigned long single_count;
392 #else
393 /* Mutex protecting addition of workshares to work_share_list_free. */
394 gomp_mutex_t work_share_list_free_lock;
395 #endif
397 /* This barrier is used for most synchronization of the team. */
398 gomp_barrier_t barrier;
400 /* Initial work shares, to avoid allocating any gomp_work_share
401 structs in the common case. */
402 struct gomp_work_share work_shares[8];
404 gomp_mutex_t task_lock;
405 struct gomp_task *task_queue;
406 /* Number of all GOMP_TASK_{WAITING,TIED} tasks in the team. */
407 unsigned int task_count;
408 /* Number of GOMP_TASK_WAITING tasks currently waiting to be scheduled. */
409 unsigned int task_queued_count;
410 /* Number of GOMP_TASK_{WAITING,TIED} tasks currently running
411 directly in gomp_barrier_handle_tasks; tasks spawned
412 from e.g. GOMP_taskwait or GOMP_taskgroup_end don't count, even when
413 that is called from a task run from gomp_barrier_handle_tasks.
414 task_running_count should be always <= team->nthreads,
415 and if current task isn't in_tied_task, then it will be
416 even < team->nthreads. */
417 unsigned int task_running_count;
418 int work_share_cancelled;
419 int team_cancelled;
421 /* This array contains structures for implicit tasks. */
422 struct gomp_task implicit_task[];
425 /* This structure contains all data that is private to libgomp and is
426 allocated per thread. */
428 struct gomp_thread
430 /* This is the function that the thread should run upon launch. */
431 void (*fn) (void *data);
432 void *data;
434 /* This is the current team state for this thread. The ts.team member
435 is NULL only if the thread is idle. */
436 struct gomp_team_state ts;
438 /* This is the task that the thread is currently executing. */
439 struct gomp_task *task;
441 /* This semaphore is used for ordered loops. */
442 gomp_sem_t release;
444 /* Place this thread is bound to plus one, or zero if not bound
445 to any place. */
446 unsigned int place;
448 /* User pthread thread pool */
449 struct gomp_thread_pool *thread_pool;
453 struct gomp_thread_pool
455 /* This array manages threads spawned from the top level, which will
456 return to the idle loop once the current PARALLEL construct ends. */
457 struct gomp_thread **threads;
458 unsigned threads_size;
459 unsigned threads_used;
460 struct gomp_team *last_team;
461 /* Number of threads running in this contention group. */
462 unsigned long threads_busy;
464 /* This barrier holds and releases threads waiting in threads. */
465 gomp_barrier_t threads_dock;
468 enum gomp_cancel_kind
470 GOMP_CANCEL_PARALLEL = 1,
471 GOMP_CANCEL_LOOP = 2,
472 GOMP_CANCEL_FOR = GOMP_CANCEL_LOOP,
473 GOMP_CANCEL_DO = GOMP_CANCEL_LOOP,
474 GOMP_CANCEL_SECTIONS = 4,
475 GOMP_CANCEL_TASKGROUP = 8
478 /* ... and here is that TLS data. */
480 #if defined HAVE_TLS || defined USE_EMUTLS
481 extern __thread struct gomp_thread gomp_tls_data;
482 static inline struct gomp_thread *gomp_thread (void)
484 return &gomp_tls_data;
486 #else
487 extern pthread_key_t gomp_tls_key;
488 static inline struct gomp_thread *gomp_thread (void)
490 return pthread_getspecific (gomp_tls_key);
492 #endif
494 extern struct gomp_task_icv *gomp_new_icv (void);
496 /* Here's how to access the current copy of the ICVs. */
498 static inline struct gomp_task_icv *gomp_icv (bool write)
500 struct gomp_task *task = gomp_thread ()->task;
501 if (task)
502 return &task->icv;
503 else if (write)
504 return gomp_new_icv ();
505 else
506 return &gomp_global_icv;
509 /* The attributes to be used during thread creation. */
510 extern pthread_attr_t gomp_thread_attr;
512 /* Function prototypes. */
514 /* affinity.c */
516 extern void gomp_init_affinity (void);
517 extern void gomp_init_thread_affinity (pthread_attr_t *, unsigned int);
518 extern void **gomp_affinity_alloc (unsigned long, bool);
519 extern void gomp_affinity_init_place (void *);
520 extern bool gomp_affinity_add_cpus (void *, unsigned long, unsigned long,
521 long, bool);
522 extern bool gomp_affinity_remove_cpu (void *, unsigned long);
523 extern bool gomp_affinity_copy_place (void *, void *, long);
524 extern bool gomp_affinity_same_place (void *, void *);
525 extern bool gomp_affinity_finalize_place_list (bool);
526 extern bool gomp_affinity_init_level (int, unsigned long, bool);
527 extern void gomp_affinity_print_place (void *);
529 /* alloc.c */
531 extern void *gomp_malloc (size_t) __attribute__((malloc));
532 extern void *gomp_malloc_cleared (size_t) __attribute__((malloc));
533 extern void *gomp_realloc (void *, size_t);
535 /* Avoid conflicting prototypes of alloca() in system headers by using
536 GCC's builtin alloca(). */
537 #define gomp_alloca(x) __builtin_alloca(x)
539 /* error.c */
541 extern void gomp_vnotify (const char *, va_list);
542 extern void gomp_notify(const char *msg, ...);
543 extern void gomp_verror (const char *, va_list);
544 extern void gomp_error (const char *, ...)
545 __attribute__((format (printf, 1, 2)));
546 extern void gomp_vfatal (const char *, va_list);
547 extern void gomp_fatal (const char *, ...)
548 __attribute__((noreturn, format (printf, 1, 2)));
550 /* iter.c */
552 extern int gomp_iter_static_next (long *, long *);
553 extern bool gomp_iter_dynamic_next_locked (long *, long *);
554 extern bool gomp_iter_guided_next_locked (long *, long *);
556 #ifdef HAVE_SYNC_BUILTINS
557 extern bool gomp_iter_dynamic_next (long *, long *);
558 extern bool gomp_iter_guided_next (long *, long *);
559 #endif
561 /* iter_ull.c */
563 extern int gomp_iter_ull_static_next (unsigned long long *,
564 unsigned long long *);
565 extern bool gomp_iter_ull_dynamic_next_locked (unsigned long long *,
566 unsigned long long *);
567 extern bool gomp_iter_ull_guided_next_locked (unsigned long long *,
568 unsigned long long *);
570 #if defined HAVE_SYNC_BUILTINS && defined __LP64__
571 extern bool gomp_iter_ull_dynamic_next (unsigned long long *,
572 unsigned long long *);
573 extern bool gomp_iter_ull_guided_next (unsigned long long *,
574 unsigned long long *);
575 #endif
577 /* ordered.c */
579 extern void gomp_ordered_first (void);
580 extern void gomp_ordered_last (void);
581 extern void gomp_ordered_next (void);
582 extern void gomp_ordered_static_init (void);
583 extern void gomp_ordered_static_next (void);
584 extern void gomp_ordered_sync (void);
586 /* parallel.c */
588 extern unsigned gomp_resolve_num_threads (unsigned, unsigned);
590 /* proc.c (in config/) */
592 extern void gomp_init_num_threads (void);
593 extern unsigned gomp_dynamic_max_threads (void);
595 /* task.c */
597 extern void gomp_init_task (struct gomp_task *, struct gomp_task *,
598 struct gomp_task_icv *);
599 extern void gomp_end_task (void);
600 extern void gomp_barrier_handle_tasks (gomp_barrier_state_t);
602 static void inline
603 gomp_finish_task (struct gomp_task *task)
605 if (__builtin_expect (task->depend_hash != NULL, 0))
606 free (task->depend_hash);
609 /* team.c */
611 extern struct gomp_team *gomp_new_team (unsigned);
612 extern void gomp_team_start (void (*) (void *), void *, unsigned,
613 unsigned, struct gomp_team *);
614 extern void gomp_team_end (void);
615 extern void gomp_free_thread (void *);
617 /* target.c */
619 extern void gomp_init_targets_once (void);
620 extern int gomp_get_num_devices (void);
622 /* work.c */
624 extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned);
625 extern void gomp_fini_work_share (struct gomp_work_share *);
626 extern bool gomp_work_share_start (bool);
627 extern void gomp_work_share_end (void);
628 extern bool gomp_work_share_end_cancel (void);
629 extern void gomp_work_share_end_nowait (void);
631 static inline void
632 gomp_work_share_init_done (void)
634 struct gomp_thread *thr = gomp_thread ();
635 if (__builtin_expect (thr->ts.last_work_share != NULL, 1))
636 gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share);
639 #ifdef HAVE_ATTRIBUTE_VISIBILITY
640 # pragma GCC visibility pop
641 #endif
643 /* Now that we're back to default visibility, include the globals. */
644 #include "libgomp_g.h"
646 /* Include omp.h by parts. */
647 #include "omp-lock.h"
648 #define _LIBGOMP_OMP_LOCK_DEFINED 1
649 #include "omp.h.in"
651 #if !defined (HAVE_ATTRIBUTE_VISIBILITY) \
652 || !defined (HAVE_ATTRIBUTE_ALIAS) \
653 || !defined (HAVE_AS_SYMVER_DIRECTIVE) \
654 || !defined (PIC) \
655 || !defined (HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT)
656 # undef LIBGOMP_GNU_SYMBOL_VERSIONING
657 #endif
659 #ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
660 extern void gomp_init_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
661 extern void gomp_destroy_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
662 extern void gomp_set_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
663 extern void gomp_unset_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
664 extern int gomp_test_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
665 extern void gomp_init_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
666 extern void gomp_destroy_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
667 extern void gomp_set_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
668 extern void gomp_unset_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
669 extern int gomp_test_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
671 extern void gomp_init_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
672 extern void gomp_destroy_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
673 extern void gomp_set_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
674 extern void gomp_unset_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
675 extern int gomp_test_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
676 extern void gomp_init_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
677 extern void gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
678 extern void gomp_set_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
679 extern void gomp_unset_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
680 extern int gomp_test_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
682 # define strong_alias(fn, al) \
683 extern __typeof (fn) al __attribute__ ((alias (#fn)));
684 # define omp_lock_symver(fn) \
685 __asm (".symver g" #fn "_30, " #fn "@@OMP_3.0"); \
686 __asm (".symver g" #fn "_25, " #fn "@OMP_1.0");
687 #else
688 # define gomp_init_lock_30 omp_init_lock
689 # define gomp_destroy_lock_30 omp_destroy_lock
690 # define gomp_set_lock_30 omp_set_lock
691 # define gomp_unset_lock_30 omp_unset_lock
692 # define gomp_test_lock_30 omp_test_lock
693 # define gomp_init_nest_lock_30 omp_init_nest_lock
694 # define gomp_destroy_nest_lock_30 omp_destroy_nest_lock
695 # define gomp_set_nest_lock_30 omp_set_nest_lock
696 # define gomp_unset_nest_lock_30 omp_unset_nest_lock
697 # define gomp_test_nest_lock_30 omp_test_nest_lock
698 #endif
700 #ifdef HAVE_ATTRIBUTE_VISIBILITY
701 # define attribute_hidden __attribute__ ((visibility ("hidden")))
702 #else
703 # define attribute_hidden
704 #endif
706 #ifdef HAVE_ATTRIBUTE_ALIAS
707 # define ialias_ulp ialias_str1(__USER_LABEL_PREFIX__)
708 # define ialias_str1(x) ialias_str2(x)
709 # define ialias_str2(x) #x
710 # define ialias(fn) \
711 extern __typeof (fn) gomp_ialias_##fn \
712 __attribute__ ((alias (#fn))) attribute_hidden;
713 # define ialias_redirect(fn) \
714 extern __typeof (fn) fn __asm__ (ialias_ulp "gomp_ialias_" #fn) attribute_hidden;
715 # define ialias_call(fn) gomp_ialias_ ## fn
716 #else
717 # define ialias(fn)
718 # define ialias_redirect(fn)
719 # define ialias_call(fn) fn
720 #endif
722 #endif /* LIBGOMP_H */