OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [libgomp/] [libgomp.h] - Diff between revs 273 and 519

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 273 Rev 519
/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
   Contributed by Richard Henderson <rth@redhat.com>.
   Contributed by Richard Henderson <rth@redhat.com>.
 
 
   This file is part of the GNU OpenMP Library (libgomp).
   This file is part of the GNU OpenMP Library (libgomp).
 
 
   Libgomp is free software; you can redistribute it and/or modify it
   Libgomp is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by
   under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   the Free Software Foundation; either version 3, or (at your option)
   any later version.
   any later version.
 
 
   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
   more details.
 
 
   Under Section 7 of GPL version 3, you are granted additional
   Under Section 7 of GPL version 3, you are granted additional
   permissions described in the GCC Runtime Library Exception, version
   permissions described in the GCC Runtime Library Exception, version
   3.1, as published by the Free Software Foundation.
   3.1, as published by the Free Software Foundation.
 
 
   You should have received a copy of the GNU General Public License and
   You should have received a copy of the GNU General Public License and
   a copy of the GCC Runtime Library Exception along with this program;
   a copy of the GCC Runtime Library Exception along with this program;
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
   <http://www.gnu.org/licenses/>.  */
   <http://www.gnu.org/licenses/>.  */
 
 
/* This file contains data types and function declarations that are not
/* This file contains data types and function declarations that are not
   part of the official OpenMP user interface.  There are declarations
   part of the official OpenMP user interface.  There are declarations
   in here that are part of the GNU OpenMP ABI, in that the compiler is
   in here that are part of the GNU OpenMP ABI, in that the compiler is
   required to know about them and use them.
   required to know about them and use them.
 
 
   The convention is that the all caps prefix "GOMP" is used group items
   The convention is that the all caps prefix "GOMP" is used group items
   that are part of the external ABI, and the lower case prefix "gomp"
   that are part of the external ABI, and the lower case prefix "gomp"
   is used group items that are completely private to the library.  */
   is used group items that are completely private to the library.  */
 
 
#ifndef LIBGOMP_H 
#ifndef LIBGOMP_H 
#define LIBGOMP_H 1
#define LIBGOMP_H 1
 
 
#include "config.h"
#include "config.h"
#include "gstdint.h"
#include "gstdint.h"
 
 
#include <pthread.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdbool.h>
 
 
#ifdef HAVE_ATTRIBUTE_VISIBILITY
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility push(hidden)
# pragma GCC visibility push(hidden)
#endif
#endif
 
 
#include "sem.h"
#include "sem.h"
#include "mutex.h"
#include "mutex.h"
#include "bar.h"
#include "bar.h"
#include "ptrlock.h"
#include "ptrlock.h"
 
 
 
 
/* This structure contains the data to control one work-sharing construct,
/* This structure contains the data to control one work-sharing construct,
   either a LOOP (FOR/DO) or a SECTIONS.  */
   either a LOOP (FOR/DO) or a SECTIONS.  */
 
 
enum gomp_schedule_type
enum gomp_schedule_type
{
{
  GFS_RUNTIME,
  GFS_RUNTIME,
  GFS_STATIC,
  GFS_STATIC,
  GFS_DYNAMIC,
  GFS_DYNAMIC,
  GFS_GUIDED,
  GFS_GUIDED,
  GFS_AUTO
  GFS_AUTO
};
};
 
 
struct gomp_work_share
struct gomp_work_share
{
{
  /* This member records the SCHEDULE clause to be used for this construct.
  /* This member records the SCHEDULE clause to be used for this construct.
     The user specification of "runtime" will already have been resolved.
     The user specification of "runtime" will already have been resolved.
     If this is a SECTIONS construct, this value will always be DYNAMIC.  */
     If this is a SECTIONS construct, this value will always be DYNAMIC.  */
  enum gomp_schedule_type sched;
  enum gomp_schedule_type sched;
 
 
  int mode;
  int mode;
 
 
  union {
  union {
    struct {
    struct {
      /* This is the chunk_size argument to the SCHEDULE clause.  */
      /* This is the chunk_size argument to the SCHEDULE clause.  */
      long chunk_size;
      long chunk_size;
 
 
      /* This is the iteration end point.  If this is a SECTIONS construct,
      /* This is the iteration end point.  If this is a SECTIONS construct,
         this is the number of contained sections.  */
         this is the number of contained sections.  */
      long end;
      long end;
 
 
      /* This is the iteration step.  If this is a SECTIONS construct, this
      /* This is the iteration step.  If this is a SECTIONS construct, this
         is always 1.  */
         is always 1.  */
      long incr;
      long incr;
    };
    };
 
 
    struct {
    struct {
      /* The same as above, but for the unsigned long long loop variants.  */
      /* The same as above, but for the unsigned long long loop variants.  */
      unsigned long long chunk_size_ull;
      unsigned long long chunk_size_ull;
      unsigned long long end_ull;
      unsigned long long end_ull;
      unsigned long long incr_ull;
      unsigned long long incr_ull;
    };
    };
  };
  };
 
 
  /* This is a circular queue that details which threads will be allowed
  /* This is a circular queue that details which threads will be allowed
     into the ordered region and in which order.  When a thread allocates
     into the ordered region and in which order.  When a thread allocates
     iterations on which it is going to work, it also registers itself at
     iterations on which it is going to work, it also registers itself at
     the end of the array.  When a thread reaches the ordered region, it
     the end of the array.  When a thread reaches the ordered region, it
     checks to see if it is the one at the head of the queue.  If not, it
     checks to see if it is the one at the head of the queue.  If not, it
     blocks on its RELEASE semaphore.  */
     blocks on its RELEASE semaphore.  */
  unsigned *ordered_team_ids;
  unsigned *ordered_team_ids;
 
 
  /* This is the number of threads that have registered themselves in
  /* This is the number of threads that have registered themselves in
     the circular queue ordered_team_ids.  */
     the circular queue ordered_team_ids.  */
  unsigned ordered_num_used;
  unsigned ordered_num_used;
 
 
  /* This is the team_id of the currently acknowledged owner of the ordered
  /* This is the team_id of the currently acknowledged owner of the ordered
     section, or -1u if the ordered section has not been acknowledged by
     section, or -1u if the ordered section has not been acknowledged by
     any thread.  This is distinguished from the thread that is *allowed*
     any thread.  This is distinguished from the thread that is *allowed*
     to take the section next.  */
     to take the section next.  */
  unsigned ordered_owner;
  unsigned ordered_owner;
 
 
  /* This is the index into the circular queue ordered_team_ids of the
  /* This is the index into the circular queue ordered_team_ids of the
     current thread that's allowed into the ordered reason.  */
     current thread that's allowed into the ordered reason.  */
  unsigned ordered_cur;
  unsigned ordered_cur;
 
 
  /* This is a chain of allocated gomp_work_share blocks, valid only
  /* This is a chain of allocated gomp_work_share blocks, valid only
     in the first gomp_work_share struct in the block.  */
     in the first gomp_work_share struct in the block.  */
  struct gomp_work_share *next_alloc;
  struct gomp_work_share *next_alloc;
 
 
  /* The above fields are written once during workshare initialization,
  /* The above fields are written once during workshare initialization,
     or related to ordered worksharing.  Make sure the following fields
     or related to ordered worksharing.  Make sure the following fields
     are in a different cache line.  */
     are in a different cache line.  */
 
 
  /* This lock protects the update of the following members.  */
  /* This lock protects the update of the following members.  */
  gomp_mutex_t lock __attribute__((aligned (64)));
  gomp_mutex_t lock __attribute__((aligned (64)));
 
 
  /* This is the count of the number of threads that have exited the work
  /* This is the count of the number of threads that have exited the work
     share construct.  If the construct was marked nowait, they have moved on
     share construct.  If the construct was marked nowait, they have moved on
     to other work; otherwise they're blocked on a barrier.  The last member
     to other work; otherwise they're blocked on a barrier.  The last member
     of the team to exit the work share construct must deallocate it.  */
     of the team to exit the work share construct must deallocate it.  */
  unsigned threads_completed;
  unsigned threads_completed;
 
 
  union {
  union {
    /* This is the next iteration value to be allocated.  In the case of
    /* This is the next iteration value to be allocated.  In the case of
       GFS_STATIC loops, this the iteration start point and never changes.  */
       GFS_STATIC loops, this the iteration start point and never changes.  */
    long next;
    long next;
 
 
    /* The same, but with unsigned long long type.  */
    /* The same, but with unsigned long long type.  */
    unsigned long long next_ull;
    unsigned long long next_ull;
 
 
    /* This is the returned data structure for SINGLE COPYPRIVATE.  */
    /* This is the returned data structure for SINGLE COPYPRIVATE.  */
    void *copyprivate;
    void *copyprivate;
  };
  };
 
 
  union {
  union {
    /* Link to gomp_work_share struct for next work sharing construct
    /* Link to gomp_work_share struct for next work sharing construct
       encountered after this one.  */
       encountered after this one.  */
    gomp_ptrlock_t next_ws;
    gomp_ptrlock_t next_ws;
 
 
    /* gomp_work_share structs are chained in the free work share cache
    /* gomp_work_share structs are chained in the free work share cache
       through this.  */
       through this.  */
    struct gomp_work_share *next_free;
    struct gomp_work_share *next_free;
  };
  };
 
 
  /* If only few threads are in the team, ordered_team_ids can point
  /* If only few threads are in the team, ordered_team_ids can point
     to this array which fills the padding at the end of this struct.  */
     to this array which fills the padding at the end of this struct.  */
  unsigned inline_ordered_team_ids[0];
  unsigned inline_ordered_team_ids[0];
};
};
 
 
/* This structure contains all of the thread-local data associated with
/* This structure contains all of the thread-local data associated with
   a thread team.  This is the data that must be saved when a thread
   a thread team.  This is the data that must be saved when a thread
   encounters a nested PARALLEL construct.  */
   encounters a nested PARALLEL construct.  */
 
 
struct gomp_team_state
struct gomp_team_state
{
{
  /* This is the team of which the thread is currently a member.  */
  /* This is the team of which the thread is currently a member.  */
  struct gomp_team *team;
  struct gomp_team *team;
 
 
  /* This is the work share construct which this thread is currently
  /* This is the work share construct which this thread is currently
     processing.  Recall that with NOWAIT, not all threads may be
     processing.  Recall that with NOWAIT, not all threads may be
     processing the same construct.  */
     processing the same construct.  */
  struct gomp_work_share *work_share;
  struct gomp_work_share *work_share;
 
 
  /* This is the previous work share construct or NULL if there wasn't any.
  /* This is the previous work share construct or NULL if there wasn't any.
     When all threads are done with the current work sharing construct,
     When all threads are done with the current work sharing construct,
     the previous one can be freed.  The current one can't, as its
     the previous one can be freed.  The current one can't, as its
     next_ws field is used.  */
     next_ws field is used.  */
  struct gomp_work_share *last_work_share;
  struct gomp_work_share *last_work_share;
 
 
  /* This is the ID of this thread within the team.  This value is
  /* This is the ID of this thread within the team.  This value is
     guaranteed to be between 0 and N-1, where N is the number of
     guaranteed to be between 0 and N-1, where N is the number of
     threads in the team.  */
     threads in the team.  */
  unsigned team_id;
  unsigned team_id;
 
 
  /* Nesting level.  */
  /* Nesting level.  */
  unsigned level;
  unsigned level;
 
 
  /* Active nesting level.  Only active parallel regions are counted.  */
  /* Active nesting level.  Only active parallel regions are counted.  */
  unsigned active_level;
  unsigned active_level;
 
 
#ifdef HAVE_SYNC_BUILTINS
#ifdef HAVE_SYNC_BUILTINS
  /* Number of single stmts encountered.  */
  /* Number of single stmts encountered.  */
  unsigned long single_count;
  unsigned long single_count;
#endif
#endif
 
 
  /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the
  /* For GFS_RUNTIME loops that resolved to GFS_STATIC, this is the
     trip number through the loop.  So first time a particular loop
     trip number through the loop.  So first time a particular loop
     is encountered this number is 0, the second time through the loop
     is encountered this number is 0, the second time through the loop
     is 1, etc.  This is unused when the compiler knows in advance that
     is 1, etc.  This is unused when the compiler knows in advance that
     the loop is statically scheduled.  */
     the loop is statically scheduled.  */
  unsigned long static_trip;
  unsigned long static_trip;
};
};
 
 
/* These are the OpenMP 3.0 Internal Control Variables described in
/* These are the OpenMP 3.0 Internal Control Variables described in
   section 2.3.1.  Those described as having one copy per task are
   section 2.3.1.  Those described as having one copy per task are
   stored within the structure; those described as having one copy
   stored within the structure; those described as having one copy
   for the whole program are (naturally) global variables.  */
   for the whole program are (naturally) global variables.  */
 
 
struct gomp_task_icv
struct gomp_task_icv
{
{
  unsigned long nthreads_var;
  unsigned long nthreads_var;
  enum gomp_schedule_type run_sched_var;
  enum gomp_schedule_type run_sched_var;
  int run_sched_modifier;
  int run_sched_modifier;
  bool dyn_var;
  bool dyn_var;
  bool nest_var;
  bool nest_var;
};
};
 
 
extern struct gomp_task_icv gomp_global_icv;
extern struct gomp_task_icv gomp_global_icv;
extern unsigned long gomp_thread_limit_var;
extern unsigned long gomp_thread_limit_var;
extern unsigned long gomp_remaining_threads_count;
extern unsigned long gomp_remaining_threads_count;
#ifndef HAVE_SYNC_BUILTINS
#ifndef HAVE_SYNC_BUILTINS
extern gomp_mutex_t gomp_remaining_threads_lock;
extern gomp_mutex_t gomp_remaining_threads_lock;
#endif
#endif
extern unsigned long gomp_max_active_levels_var;
extern unsigned long gomp_max_active_levels_var;
extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var;
extern unsigned long long gomp_spin_count_var, gomp_throttled_spin_count_var;
extern unsigned long gomp_available_cpus, gomp_managed_threads;
extern unsigned long gomp_available_cpus, gomp_managed_threads;
 
 
enum gomp_task_kind
enum gomp_task_kind
{
{
  GOMP_TASK_IMPLICIT,
  GOMP_TASK_IMPLICIT,
  GOMP_TASK_IFFALSE,
  GOMP_TASK_IFFALSE,
  GOMP_TASK_WAITING,
  GOMP_TASK_WAITING,
  GOMP_TASK_TIED
  GOMP_TASK_TIED
};
};
 
 
/* This structure describes a "task" to be run by a thread.  */
/* This structure describes a "task" to be run by a thread.  */
 
 
struct gomp_task
struct gomp_task
{
{
  struct gomp_task *parent;
  struct gomp_task *parent;
  struct gomp_task *children;
  struct gomp_task *children;
  struct gomp_task *next_child;
  struct gomp_task *next_child;
  struct gomp_task *prev_child;
  struct gomp_task *prev_child;
  struct gomp_task *next_queue;
  struct gomp_task *next_queue;
  struct gomp_task *prev_queue;
  struct gomp_task *prev_queue;
  struct gomp_task_icv icv;
  struct gomp_task_icv icv;
  void (*fn) (void *);
  void (*fn) (void *);
  void *fn_data;
  void *fn_data;
  enum gomp_task_kind kind;
  enum gomp_task_kind kind;
  bool in_taskwait;
  bool in_taskwait;
  bool in_tied_task;
  bool in_tied_task;
  gomp_sem_t taskwait_sem;
  gomp_sem_t taskwait_sem;
};
};
 
 
/* This structure describes a "team" of threads.  These are the threads
/* This structure describes a "team" of threads.  These are the threads
   that are spawned by a PARALLEL constructs, as well as the work sharing
   that are spawned by a PARALLEL constructs, as well as the work sharing
   constructs that the team encounters.  */
   constructs that the team encounters.  */
 
 
struct gomp_team
struct gomp_team
{
{
  /* This is the number of threads in the current team.  */
  /* This is the number of threads in the current team.  */
  unsigned nthreads;
  unsigned nthreads;
 
 
  /* This is number of gomp_work_share structs that have been allocated
  /* This is number of gomp_work_share structs that have been allocated
     as a block last time.  */
     as a block last time.  */
  unsigned work_share_chunk;
  unsigned work_share_chunk;
 
 
  /* This is the saved team state that applied to a master thread before
  /* This is the saved team state that applied to a master thread before
     the current thread was created.  */
     the current thread was created.  */
  struct gomp_team_state prev_ts;
  struct gomp_team_state prev_ts;
 
 
  /* This semaphore should be used by the master thread instead of its
  /* This semaphore should be used by the master thread instead of its
     "native" semaphore in the thread structure.  Required for nested
     "native" semaphore in the thread structure.  Required for nested
     parallels, as the master is a member of two teams.  */
     parallels, as the master is a member of two teams.  */
  gomp_sem_t master_release;
  gomp_sem_t master_release;
 
 
  /* This points to an array with pointers to the release semaphore
  /* This points to an array with pointers to the release semaphore
     of the threads in the team.  */
     of the threads in the team.  */
  gomp_sem_t **ordered_release;
  gomp_sem_t **ordered_release;
 
 
  /* List of gomp_work_share structs chained through next_free fields.
  /* List of gomp_work_share structs chained through next_free fields.
     This is populated and taken off only by the first thread in the
     This is populated and taken off only by the first thread in the
     team encountering a new work sharing construct, in a critical
     team encountering a new work sharing construct, in a critical
     section.  */
     section.  */
  struct gomp_work_share *work_share_list_alloc;
  struct gomp_work_share *work_share_list_alloc;
 
 
  /* List of gomp_work_share structs freed by free_work_share.  New
  /* List of gomp_work_share structs freed by free_work_share.  New
     entries are atomically added to the start of the list, and
     entries are atomically added to the start of the list, and
     alloc_work_share can safely only move all but the first entry
     alloc_work_share can safely only move all but the first entry
     to work_share_list alloc, as free_work_share can happen concurrently
     to work_share_list alloc, as free_work_share can happen concurrently
     with alloc_work_share.  */
     with alloc_work_share.  */
  struct gomp_work_share *work_share_list_free;
  struct gomp_work_share *work_share_list_free;
 
 
#ifdef HAVE_SYNC_BUILTINS
#ifdef HAVE_SYNC_BUILTINS
  /* Number of simple single regions encountered by threads in this
  /* Number of simple single regions encountered by threads in this
     team.  */
     team.  */
  unsigned long single_count;
  unsigned long single_count;
#else
#else
  /* Mutex protecting addition of workshares to work_share_list_free.  */
  /* Mutex protecting addition of workshares to work_share_list_free.  */
  gomp_mutex_t work_share_list_free_lock;
  gomp_mutex_t work_share_list_free_lock;
#endif
#endif
 
 
  /* This barrier is used for most synchronization of the team.  */
  /* This barrier is used for most synchronization of the team.  */
  gomp_barrier_t barrier;
  gomp_barrier_t barrier;
 
 
  /* Initial work shares, to avoid allocating any gomp_work_share
  /* Initial work shares, to avoid allocating any gomp_work_share
     structs in the common case.  */
     structs in the common case.  */
  struct gomp_work_share work_shares[8];
  struct gomp_work_share work_shares[8];
 
 
  gomp_mutex_t task_lock;
  gomp_mutex_t task_lock;
  struct gomp_task *task_queue;
  struct gomp_task *task_queue;
  int task_count;
  int task_count;
  int task_running_count;
  int task_running_count;
 
 
  /* This array contains structures for implicit tasks.  */
  /* This array contains structures for implicit tasks.  */
  struct gomp_task implicit_task[];
  struct gomp_task implicit_task[];
};
};
 
 
/* This structure contains all data that is private to libgomp and is
/* This structure contains all data that is private to libgomp and is
   allocated per thread.  */
   allocated per thread.  */
 
 
struct gomp_thread
struct gomp_thread
{
{
  /* This is the function that the thread should run upon launch.  */
  /* This is the function that the thread should run upon launch.  */
  void (*fn) (void *data);
  void (*fn) (void *data);
  void *data;
  void *data;
 
 
  /* This is the current team state for this thread.  The ts.team member
  /* This is the current team state for this thread.  The ts.team member
     is NULL only if the thread is idle.  */
     is NULL only if the thread is idle.  */
  struct gomp_team_state ts;
  struct gomp_team_state ts;
 
 
  /* This is the task that the thread is currently executing.  */
  /* This is the task that the thread is currently executing.  */
  struct gomp_task *task;
  struct gomp_task *task;
 
 
  /* This semaphore is used for ordered loops.  */
  /* This semaphore is used for ordered loops.  */
  gomp_sem_t release;
  gomp_sem_t release;
 
 
  /* user pthread thread pool */
  /* user pthread thread pool */
  struct gomp_thread_pool *thread_pool;
  struct gomp_thread_pool *thread_pool;
};
};
 
 
 
 
struct gomp_thread_pool
struct gomp_thread_pool
{
{
  /* This array manages threads spawned from the top level, which will
  /* This array manages threads spawned from the top level, which will
     return to the idle loop once the current PARALLEL construct ends.  */
     return to the idle loop once the current PARALLEL construct ends.  */
  struct gomp_thread **threads;
  struct gomp_thread **threads;
  unsigned threads_size;
  unsigned threads_size;
  unsigned threads_used;
  unsigned threads_used;
  struct gomp_team *last_team;
  struct gomp_team *last_team;
 
 
  /* This barrier holds and releases threads waiting in threads.  */
  /* This barrier holds and releases threads waiting in threads.  */
  gomp_barrier_t threads_dock;
  gomp_barrier_t threads_dock;
};
};
 
 
/* ... and here is that TLS data.  */
/* ... and here is that TLS data.  */
 
 
#ifdef HAVE_TLS
#ifdef HAVE_TLS
extern __thread struct gomp_thread gomp_tls_data;
extern __thread struct gomp_thread gomp_tls_data;
static inline struct gomp_thread *gomp_thread (void)
static inline struct gomp_thread *gomp_thread (void)
{
{
  return &gomp_tls_data;
  return &gomp_tls_data;
}
}
#else
#else
extern pthread_key_t gomp_tls_key;
extern pthread_key_t gomp_tls_key;
static inline struct gomp_thread *gomp_thread (void)
static inline struct gomp_thread *gomp_thread (void)
{
{
  return pthread_getspecific (gomp_tls_key);
  return pthread_getspecific (gomp_tls_key);
}
}
#endif
#endif
 
 
extern struct gomp_task_icv *gomp_new_icv (void);
extern struct gomp_task_icv *gomp_new_icv (void);
 
 
/* Here's how to access the current copy of the ICVs.  */
/* Here's how to access the current copy of the ICVs.  */
 
 
static inline struct gomp_task_icv *gomp_icv (bool write)
static inline struct gomp_task_icv *gomp_icv (bool write)
{
{
  struct gomp_task *task = gomp_thread ()->task;
  struct gomp_task *task = gomp_thread ()->task;
  if (task)
  if (task)
    return &task->icv;
    return &task->icv;
  else if (write)
  else if (write)
    return gomp_new_icv ();
    return gomp_new_icv ();
  else
  else
    return &gomp_global_icv;
    return &gomp_global_icv;
}
}
 
 
/* The attributes to be used during thread creation.  */
/* The attributes to be used during thread creation.  */
extern pthread_attr_t gomp_thread_attr;
extern pthread_attr_t gomp_thread_attr;
 
 
/* Other variables.  */
/* Other variables.  */
 
 
extern unsigned short *gomp_cpu_affinity;
extern unsigned short *gomp_cpu_affinity;
extern size_t gomp_cpu_affinity_len;
extern size_t gomp_cpu_affinity_len;
 
 
/* Function prototypes.  */
/* Function prototypes.  */
 
 
/* affinity.c */
/* affinity.c */
 
 
extern void gomp_init_affinity (void);
extern void gomp_init_affinity (void);
extern void gomp_init_thread_affinity (pthread_attr_t *);
extern void gomp_init_thread_affinity (pthread_attr_t *);
 
 
/* alloc.c */
/* alloc.c */
 
 
extern void *gomp_malloc (size_t) __attribute__((malloc));
extern void *gomp_malloc (size_t) __attribute__((malloc));
extern void *gomp_malloc_cleared (size_t) __attribute__((malloc));
extern void *gomp_malloc_cleared (size_t) __attribute__((malloc));
extern void *gomp_realloc (void *, size_t);
extern void *gomp_realloc (void *, size_t);
 
 
/* Avoid conflicting prototypes of alloca() in system headers by using
/* Avoid conflicting prototypes of alloca() in system headers by using
   GCC's builtin alloca().  */
   GCC's builtin alloca().  */
#define gomp_alloca(x)  __builtin_alloca(x)
#define gomp_alloca(x)  __builtin_alloca(x)
 
 
/* error.c */
/* error.c */
 
 
extern void gomp_error (const char *, ...)
extern void gomp_error (const char *, ...)
        __attribute__((format (printf, 1, 2)));
        __attribute__((format (printf, 1, 2)));
extern void gomp_fatal (const char *, ...)
extern void gomp_fatal (const char *, ...)
        __attribute__((noreturn, format (printf, 1, 2)));
        __attribute__((noreturn, format (printf, 1, 2)));
 
 
/* iter.c */
/* iter.c */
 
 
extern int gomp_iter_static_next (long *, long *);
extern int gomp_iter_static_next (long *, long *);
extern bool gomp_iter_dynamic_next_locked (long *, long *);
extern bool gomp_iter_dynamic_next_locked (long *, long *);
extern bool gomp_iter_guided_next_locked (long *, long *);
extern bool gomp_iter_guided_next_locked (long *, long *);
 
 
#ifdef HAVE_SYNC_BUILTINS
#ifdef HAVE_SYNC_BUILTINS
extern bool gomp_iter_dynamic_next (long *, long *);
extern bool gomp_iter_dynamic_next (long *, long *);
extern bool gomp_iter_guided_next (long *, long *);
extern bool gomp_iter_guided_next (long *, long *);
#endif
#endif
 
 
/* iter_ull.c */
/* iter_ull.c */
 
 
extern int gomp_iter_ull_static_next (unsigned long long *,
extern int gomp_iter_ull_static_next (unsigned long long *,
                                      unsigned long long *);
                                      unsigned long long *);
extern bool gomp_iter_ull_dynamic_next_locked (unsigned long long *,
extern bool gomp_iter_ull_dynamic_next_locked (unsigned long long *,
                                               unsigned long long *);
                                               unsigned long long *);
extern bool gomp_iter_ull_guided_next_locked (unsigned long long *,
extern bool gomp_iter_ull_guided_next_locked (unsigned long long *,
                                              unsigned long long *);
                                              unsigned long long *);
 
 
#if defined HAVE_SYNC_BUILTINS && defined __LP64__
#if defined HAVE_SYNC_BUILTINS && defined __LP64__
extern bool gomp_iter_ull_dynamic_next (unsigned long long *,
extern bool gomp_iter_ull_dynamic_next (unsigned long long *,
                                        unsigned long long *);
                                        unsigned long long *);
extern bool gomp_iter_ull_guided_next (unsigned long long *,
extern bool gomp_iter_ull_guided_next (unsigned long long *,
                                       unsigned long long *);
                                       unsigned long long *);
#endif
#endif
 
 
/* ordered.c */
/* ordered.c */
 
 
extern void gomp_ordered_first (void);
extern void gomp_ordered_first (void);
extern void gomp_ordered_last (void);
extern void gomp_ordered_last (void);
extern void gomp_ordered_next (void);
extern void gomp_ordered_next (void);
extern void gomp_ordered_static_init (void);
extern void gomp_ordered_static_init (void);
extern void gomp_ordered_static_next (void);
extern void gomp_ordered_static_next (void);
extern void gomp_ordered_sync (void);
extern void gomp_ordered_sync (void);
 
 
/* parallel.c */
/* parallel.c */
 
 
extern unsigned gomp_resolve_num_threads (unsigned, unsigned);
extern unsigned gomp_resolve_num_threads (unsigned, unsigned);
 
 
/* proc.c (in config/) */
/* proc.c (in config/) */
 
 
extern void gomp_init_num_threads (void);
extern void gomp_init_num_threads (void);
extern unsigned gomp_dynamic_max_threads (void);
extern unsigned gomp_dynamic_max_threads (void);
 
 
/* task.c */
/* task.c */
 
 
extern void gomp_init_task (struct gomp_task *, struct gomp_task *,
extern void gomp_init_task (struct gomp_task *, struct gomp_task *,
                            struct gomp_task_icv *);
                            struct gomp_task_icv *);
extern void gomp_end_task (void);
extern void gomp_end_task (void);
extern void gomp_barrier_handle_tasks (gomp_barrier_state_t);
extern void gomp_barrier_handle_tasks (gomp_barrier_state_t);
 
 
static void inline
static void inline
gomp_finish_task (struct gomp_task *task)
gomp_finish_task (struct gomp_task *task)
{
{
  gomp_sem_destroy (&task->taskwait_sem);
  gomp_sem_destroy (&task->taskwait_sem);
}
}
 
 
/* team.c */
/* team.c */
 
 
extern struct gomp_team *gomp_new_team (unsigned);
extern struct gomp_team *gomp_new_team (unsigned);
extern void gomp_team_start (void (*) (void *), void *, unsigned,
extern void gomp_team_start (void (*) (void *), void *, unsigned,
                             struct gomp_team *);
                             struct gomp_team *);
extern void gomp_team_end (void);
extern void gomp_team_end (void);
 
 
/* work.c */
/* work.c */
 
 
extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned);
extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned);
extern void gomp_fini_work_share (struct gomp_work_share *);
extern void gomp_fini_work_share (struct gomp_work_share *);
extern bool gomp_work_share_start (bool);
extern bool gomp_work_share_start (bool);
extern void gomp_work_share_end (void);
extern void gomp_work_share_end (void);
extern void gomp_work_share_end_nowait (void);
extern void gomp_work_share_end_nowait (void);
 
 
static inline void
static inline void
gomp_work_share_init_done (void)
gomp_work_share_init_done (void)
{
{
  struct gomp_thread *thr = gomp_thread ();
  struct gomp_thread *thr = gomp_thread ();
  if (__builtin_expect (thr->ts.last_work_share != NULL, 1))
  if (__builtin_expect (thr->ts.last_work_share != NULL, 1))
    gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share);
    gomp_ptrlock_set (&thr->ts.last_work_share->next_ws, thr->ts.work_share);
}
}
 
 
#ifdef HAVE_ATTRIBUTE_VISIBILITY
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility pop
# pragma GCC visibility pop
#endif
#endif
 
 
/* Now that we're back to default visibility, include the globals.  */
/* Now that we're back to default visibility, include the globals.  */
#include "libgomp_g.h"
#include "libgomp_g.h"
 
 
/* Include omp.h by parts.  */
/* Include omp.h by parts.  */
#include "omp-lock.h"
#include "omp-lock.h"
#define _LIBGOMP_OMP_LOCK_DEFINED 1
#define _LIBGOMP_OMP_LOCK_DEFINED 1
#include "omp.h.in"
#include "omp.h.in"
 
 
#if !defined (HAVE_ATTRIBUTE_VISIBILITY) \
#if !defined (HAVE_ATTRIBUTE_VISIBILITY) \
    || !defined (HAVE_ATTRIBUTE_ALIAS) \
    || !defined (HAVE_ATTRIBUTE_ALIAS) \
    || !defined (HAVE_AS_SYMVER_DIRECTIVE) \
    || !defined (HAVE_AS_SYMVER_DIRECTIVE) \
    || !defined (PIC)
    || !defined (PIC)
# undef LIBGOMP_GNU_SYMBOL_VERSIONING
# undef LIBGOMP_GNU_SYMBOL_VERSIONING
#endif
#endif
 
 
#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
#ifdef LIBGOMP_GNU_SYMBOL_VERSIONING
extern void gomp_init_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_init_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_destroy_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_destroy_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_set_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_set_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_unset_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_unset_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern int gomp_test_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern int gomp_test_lock_30 (omp_lock_t *) __GOMP_NOTHROW;
extern void gomp_init_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_init_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_destroy_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_destroy_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_set_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_set_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_unset_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern void gomp_unset_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern int gomp_test_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
extern int gomp_test_nest_lock_30 (omp_nest_lock_t *) __GOMP_NOTHROW;
 
 
extern void gomp_init_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_init_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_destroy_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_destroy_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_set_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_set_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_unset_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_unset_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern int gomp_test_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern int gomp_test_lock_25 (omp_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_init_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_init_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_destroy_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_set_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_set_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_unset_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern void gomp_unset_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern int gomp_test_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
extern int gomp_test_nest_lock_25 (omp_nest_lock_25_t *) __GOMP_NOTHROW;
 
 
# define strong_alias(fn, al) \
# define strong_alias(fn, al) \
  extern __typeof (fn) al __attribute__ ((alias (#fn)));
  extern __typeof (fn) al __attribute__ ((alias (#fn)));
# define omp_lock_symver(fn) \
# define omp_lock_symver(fn) \
  __asm (".symver g" #fn "_30, " #fn "@@OMP_3.0"); \
  __asm (".symver g" #fn "_30, " #fn "@@OMP_3.0"); \
  __asm (".symver g" #fn "_25, " #fn "@OMP_1.0");
  __asm (".symver g" #fn "_25, " #fn "@OMP_1.0");
#else
#else
# define gomp_init_lock_30 omp_init_lock
# define gomp_init_lock_30 omp_init_lock
# define gomp_destroy_lock_30 omp_destroy_lock
# define gomp_destroy_lock_30 omp_destroy_lock
# define gomp_set_lock_30 omp_set_lock
# define gomp_set_lock_30 omp_set_lock
# define gomp_unset_lock_30 omp_unset_lock
# define gomp_unset_lock_30 omp_unset_lock
# define gomp_test_lock_30 omp_test_lock
# define gomp_test_lock_30 omp_test_lock
# define gomp_init_nest_lock_30 omp_init_nest_lock
# define gomp_init_nest_lock_30 omp_init_nest_lock
# define gomp_destroy_nest_lock_30 omp_destroy_nest_lock
# define gomp_destroy_nest_lock_30 omp_destroy_nest_lock
# define gomp_set_nest_lock_30 omp_set_nest_lock
# define gomp_set_nest_lock_30 omp_set_nest_lock
# define gomp_unset_nest_lock_30 omp_unset_nest_lock
# define gomp_unset_nest_lock_30 omp_unset_nest_lock
# define gomp_test_nest_lock_30 omp_test_nest_lock
# define gomp_test_nest_lock_30 omp_test_nest_lock
#endif
#endif
 
 
#ifdef HAVE_ATTRIBUTE_VISIBILITY
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# define attribute_hidden __attribute__ ((visibility ("hidden")))
# define attribute_hidden __attribute__ ((visibility ("hidden")))
#else
#else
# define attribute_hidden
# define attribute_hidden
#endif
#endif
 
 
#ifdef HAVE_ATTRIBUTE_ALIAS
#ifdef HAVE_ATTRIBUTE_ALIAS
# define ialias(fn) \
# define ialias(fn) \
  extern __typeof (fn) gomp_ialias_##fn \
  extern __typeof (fn) gomp_ialias_##fn \
    __attribute__ ((alias (#fn))) attribute_hidden;
    __attribute__ ((alias (#fn))) attribute_hidden;
#else
#else
# define ialias(fn)
# define ialias(fn)
#endif
#endif
 
 
#endif /* LIBGOMP_H */
#endif /* LIBGOMP_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.