summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-22 11:18:23 +0000
committercltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-22 11:18:23 +0000
commitab0c752a1671499fc2de8fcf87b2c55ee9ba1a18 (patch)
treeecca4f8f4b19e3c0194681ae7d7259199e318a16
parentd55ab4fbb19203c14ed2592d54db67929797ccff (diff)
downloadgcc-ab0c752a1671499fc2de8fcf87b2c55ee9ba1a18.tar.gz
2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
Backport from mainline: 2015-09-22 Chung-Lin Tang <cltang@codesourcery.com> PR libgomp/67141 * oacc-int.h (goacc_host_init): Add declaration. * oacc-host.c (goacc_host_init): Remove static and constructor attribute. * oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@228011 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgomp/ChangeLog11
-rw-r--r--libgomp/oacc-host.c4
-rw-r--r--libgomp/oacc-init.c3
-rw-r--r--libgomp/oacc-int.h1
4 files changed, 17 insertions, 2 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index d59d80b4773..603809966e1 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,14 @@
+2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline:
+
+ 2015-09-22 Chung-Lin Tang <cltang@codesourcery.com>
+
+ PR libgomp/67141
+ * oacc-int.h (goacc_host_init): Add declaration.
+ * oacc-host.c (goacc_host_init): Remove static and constructor attribute.
+ * oacc-init.c (goacc_runtime_initialize): Call goacc_host_init() at end.
+
2015-08-24 Joost VandeVondele <vondele@gnu.gcc.org>
PR libgomp/66761
diff --git a/libgomp/oacc-host.c b/libgomp/oacc-host.c
index 6dcdbf3658e..042d6d88dec 100644
--- a/libgomp/oacc-host.c
+++ b/libgomp/oacc-host.c
@@ -82,8 +82,8 @@ static struct gomp_device_descr host_dispatch =
};
/* Register this device type. */
-static __attribute__ ((constructor))
-void goacc_host_init (void)
+void
+goacc_host_init (void)
{
gomp_mutex_init (&host_dispatch.lock);
goacc_register (&host_dispatch);
diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index a7c2e0d8208..339f2fa397a 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -580,6 +580,9 @@ goacc_runtime_initialize (void)
goacc_threads = NULL;
gomp_mutex_init (&goacc_thread_lock);
+
+ /* Initialize and register the 'host' device type. */
+ goacc_host_init ();
}
/* Compiler helper functions */
diff --git a/libgomp/oacc-int.h b/libgomp/oacc-int.h
index 0ace737884a..f11e216c44f 100644
--- a/libgomp/oacc-int.h
+++ b/libgomp/oacc-int.h
@@ -97,6 +97,7 @@ void goacc_runtime_initialize (void);
void goacc_save_and_set_bind (acc_device_t);
void goacc_restore_bind (void);
void goacc_lazy_initialize (void);
+void goacc_host_init (void);
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility pop