aboutsummaryrefslogtreecommitdiff
path: root/libgomp/config/posix
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-04-04 17:44:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-04-04 17:44:20 +0200
commita0884cf09ee0b132930c5ad0f16736f9681f3b07 (patch)
treeac821b38fafbfdcd8c9ded3ac49ca98b9174d998 /libgomp/config/posix
parent6acd883864e3cff5895962772cca141bbbf3d2ad (diff)
downloadgcc-a0884cf09ee0b132930c5ad0f16736f9681f3b07.zip
gcc-a0884cf09ee0b132930c5ad0f16736f9681f3b07.tar.gz
gcc-a0884cf09ee0b132930c5ad0f16736f9681f3b07.tar.bz2
libgomp.h (gomp_cpu_affinity, [...]): New extern decls.
* libgomp.h (gomp_cpu_affinity, gomp_cpu_affinity_len): New extern decls. (gomp_init_affinity, gomp_init_thread_affinity): New prototypes. * env.c (gomp_cpu_affinity, gomp_cpu_affinity_len): New variables. (parse_affinity): New function. (initialize_env): Call it and gomp_init_affinity. * team.c (gomp_team_start): If gomp_cpu_affinity != NULL, create new pthread_attr_t and call gomp_init_thread_affinity on it for each thread before passing the attribute to pthread_create. * config/linux/affinity.c: New file. * config/posix/affinity.c: New file. * configure.ac (HAVE_PTHREAD_AFFINITY_NP): New test. * configure: Rebuilt. * config.h.in: Rebuilt. * Makefile.am (libgomp_la_SOURCES): Add affinity.c. * Makefile.in: Rebuilt. From-SVN: r123494
Diffstat (limited to 'libgomp/config/posix')
-rw-r--r--libgomp/config/posix/affinity.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libgomp/config/posix/affinity.c b/libgomp/config/posix/affinity.c
new file mode 100644
index 0000000..67cb37a
--- /dev/null
+++ b/libgomp/config/posix/affinity.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ does not by itself cause the resulting executable to be covered by the
+ GNU General Public License. This exception does not however invalidate
+ any other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
+/* This is a generic stub implementation of a CPU affinity setting. */
+
+#include "libgomp.h"
+
+void
+gomp_init_affinity (void)
+{
+}
+
+void
+gomp_init_thread_affinity (pthread_attr_t *attr)
+{
+ (void) attr;
+}