diff mbox

[gomp4] Don't put acc_notify_var in thread-local struct

Message ID 20141028163729.45bc231b@octopus
State New
Headers show

Commit Message

Julian Brown Oct. 28, 2014, 4:37 p.m. UTC
Hi,

This patch moves acc_notify_var out of gomp_task_icv and makes it
simply a global variable instead.

OK for gomp4 branch?

Thanks,

Julian

ChangeLog

    libgomp/
    * env.c (goacc_notify_var): New.
    (initialize_env): Use above instead of
    gomp_global_icv.acc_notify_var.
    * error.c (gomp_vnotify): Use goacc_notify_var.
    (gomp_notify): Fix formatting.
    * libgomp.h (gomp_task_icv): Remove acc_notify_var field.
    (goacc_notify_var): Add extern declaration.

Comments

Thomas Schwinge Oct. 28, 2014, 7:24 p.m. UTC | #1
Hi Julian!

On Tue, 28 Oct 2014 16:37:29 +0000, Julian Brown <julian@codesourcery.com> wrote:
> This patch moves acc_notify_var out of gomp_task_icv and makes it
> simply a global variable instead.
> 
> OK for gomp4 branch?

Yes, thanks!

>     libgomp/
>     * env.c (goacc_notify_var): New.
>     (initialize_env): Use above instead of
>     gomp_global_icv.acc_notify_var.
>     * error.c (gomp_vnotify): Use goacc_notify_var.
>     (gomp_notify): Fix formatting.
>     * libgomp.h (gomp_task_icv): Remove acc_notify_var field.
>     (goacc_notify_var): Add extern declaration.


Grüße,
 Thomas
diff mbox

Patch

commit 5b18c3e134779ee562af11702d2ba2c4baa66370
Author: Julian Brown <julian@codesourcery.com>
Date:   Tue Oct 28 06:45:41 2014 -0700

    acc_notify_var tweaks

diff --git a/libgomp/env.c b/libgomp/env.c
index 02bce0c..03206dd 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -79,6 +79,7 @@  unsigned long gomp_bind_var_list_len;
 void **gomp_places_list;
 unsigned long gomp_places_list_len;
 
+int goacc_notify_var;
 int goacc_device_num;
 char* goacc_device_type;
 
@@ -1196,7 +1197,7 @@  initialize_env (void)
       gomp_global_icv.thread_limit_var
 	= thread_limit_var > INT_MAX ? UINT_MAX : thread_limit_var;
     }
-  parse_int ("GCC_ACC_NOTIFY", &gomp_global_icv.acc_notify_var, true);
+  parse_int ("GCC_ACC_NOTIFY", &goacc_notify_var, true);
 #ifndef HAVE_SYNC_BUILTINS
   gomp_mutex_init (&gomp_managed_threads_lock);
 #endif
diff --git a/libgomp/error.c b/libgomp/error.c
index 5f400cc..320b4d2 100644
--- a/libgomp/error.c
+++ b/libgomp/error.c
@@ -76,13 +76,12 @@  gomp_fatal (const char *fmt, ...)
 void
 gomp_vnotify (const char *msg, va_list list)
 {
-  struct gomp_task_icv *icv = gomp_icv (false);
-  if (icv->acc_notify_var)
+  if (goacc_notify_var)
     vfprintf (stderr, msg, list);
 }
 
 void
-gomp_notify(const char *msg, ...)
+gomp_notify (const char *msg, ...)
 {
   va_list list;
   
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index 8b7327d..206b293 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -238,7 +238,6 @@  struct gomp_task_icv
   bool dyn_var;
   bool nest_var;
   char bind_var;
-  int acc_notify_var;
   /* Internal ICV.  */
   struct target_mem_desc *target_data;
 };
@@ -257,6 +256,7 @@  extern unsigned long gomp_bind_var_list_len;
 extern void **gomp_places_list;
 extern unsigned long gomp_places_list_len;
 
+extern int goacc_notify_var;
 extern int goacc_device_num;
 extern char* goacc_device_type;