diff mbox

[gomp3.1] Some initial library changes from OpenMP 3.1 draft

Message ID 20110224163244.GR30899@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 24, 2011, 4:32 p.m. UTC
Hi!

I've created a new branch, branches/gomp-3_1-branch, and checked in
the following patch.  omp_in_final is still stubbed and the removal
of omp_integer_kind/omp_logical_kind is IMHO a mistake, will see
if it isn't changed again.

2011-02-24  Jakub Jelinek  <jakub@redhat.com>

	* omp.h.in (omp_in_final): New prototype.
	* omp_lib.f90.in (omp_in_final): New interface.
	* omp_lib.h.in (omp_sched_static, omp_sched_dynamic,
	omp_sched_guided, omp_sched_auto): Use omp_sched_kind
	kind for the parameters.
	(omp_in_final): New external.
	* task.c (omp_in_final): New function.
	* fortran.c (omp_in_final_): Likewise.
	* libgomp.map (OMP_3.1): Export omp_in_final and omp_in_final_.

	PR fortran/42041
	* omp_lib.f90.in (omp_integer_kind, omp_logical_kind): Remove
	and replace all its uses in the module with 4.


	Jakub
diff mbox

Patch

--- libgomp/omp.h.in.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/omp.h.in	2011-02-24 15:22:54.000000000 +0100
@@ -1,4 +1,4 @@ 
-/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU OpenMP Library (libgomp).
@@ -98,6 +98,8 @@  int omp_get_ancestor_thread_num (int) __
 int omp_get_team_size (int) __GOMP_NOTHROW;
 int omp_get_active_level (void) __GOMP_NOTHROW;
 
+int omp_in_final (void) __GOMP_NOTHROW;
+
 #ifdef __cplusplus
 }
 #endif
--- libgomp/omp_lib.f90.in.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/omp_lib.f90.in	2011-02-24 16:33:08.000000000 +0100
@@ -1,4 +1,4 @@ 
-!  Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+!  Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
 !  Contributed by Jakub Jelinek <jakub@redhat.com>.
 
 !  This file is part of the GNU OpenMP Library (libgomp).
@@ -24,8 +24,6 @@ 
 
       module omp_lib_kinds
         implicit none
-        integer, parameter :: omp_integer_kind = 4
-        integer, parameter :: omp_logical_kind = 4
         integer, parameter :: omp_lock_kind = @OMP_LOCK_KIND@
         integer, parameter :: omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@
         integer, parameter :: omp_sched_kind = 4
@@ -126,28 +124,28 @@ 
         interface
           function omp_get_dynamic ()
             use omp_lib_kinds
-            logical (omp_logical_kind) :: omp_get_dynamic
+            logical (4) :: omp_get_dynamic
           end function omp_get_dynamic
         end interface
 
         interface
           function omp_get_nested ()
             use omp_lib_kinds
-            logical (omp_logical_kind) :: omp_get_nested
+            logical (4) :: omp_get_nested
           end function omp_get_nested
         end interface
 
         interface
           function omp_in_parallel ()
             use omp_lib_kinds
-            logical (omp_logical_kind) :: omp_in_parallel
+            logical (4) :: omp_in_parallel
           end function omp_in_parallel
         end interface
 
         interface
           function omp_test_lock (lock)
             use omp_lib_kinds
-            logical (omp_logical_kind) :: omp_test_lock
+            logical (4) :: omp_test_lock
             integer (omp_lock_kind), intent (inout) :: lock
           end function omp_test_lock
         end interface
@@ -155,35 +153,35 @@ 
         interface
           function omp_get_max_threads ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_max_threads
+            integer (4) :: omp_get_max_threads
           end function omp_get_max_threads
         end interface
 
         interface
           function omp_get_num_procs ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_num_procs
+            integer (4) :: omp_get_num_procs
           end function omp_get_num_procs
         end interface
 
         interface
           function omp_get_num_threads ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_num_threads
+            integer (4) :: omp_get_num_threads
           end function omp_get_num_threads
         end interface
 
         interface
           function omp_get_thread_num ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_thread_num
+            integer (4) :: omp_get_thread_num
           end function omp_get_thread_num
         end interface
 
         interface
           function omp_test_nest_lock (lock)
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_test_nest_lock
+            integer (4) :: omp_test_nest_lock
             integer (omp_nest_lock_kind), intent (inout) :: lock
           end function omp_test_nest_lock
         end interface
@@ -229,7 +227,7 @@ 
         interface
           function omp_get_thread_limit ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_thread_limit
+            integer (4) :: omp_get_thread_limit
           end function omp_get_thread_limit
         end interface
 
@@ -247,14 +245,14 @@ 
         interface
           function omp_get_max_active_levels ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_max_active_levels
+            integer (4) :: omp_get_max_active_levels
           end function omp_get_max_active_levels
         end interface
 
         interface
           function omp_get_level ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_level
+            integer (4) :: omp_get_level
           end function omp_get_level
         end interface
 
@@ -262,12 +260,12 @@ 
           function omp_get_ancestor_thread_num (level)
             use omp_lib_kinds
             integer (4), intent (in) :: level
-            integer (omp_integer_kind) :: omp_get_ancestor_thread_num
+            integer (4) :: omp_get_ancestor_thread_num
           end function omp_get_ancestor_thread_num
           function omp_get_ancestor_thread_num_8 (level)
             use omp_lib_kinds
             integer (8), intent (in) :: level
-            integer (omp_integer_kind) :: omp_get_ancestor_thread_num_8
+            integer (4) :: omp_get_ancestor_thread_num_8
           end function omp_get_ancestor_thread_num_8
         end interface
 
@@ -275,20 +273,27 @@ 
           function omp_get_team_size (level)
             use omp_lib_kinds
             integer (4), intent (in) :: level
-            integer (omp_integer_kind) :: omp_get_team_size
+            integer (4) :: omp_get_team_size
           end function omp_get_team_size
           function omp_get_team_size_8 (level)
             use omp_lib_kinds
             integer (8), intent (in) :: level
-            integer (omp_integer_kind) :: omp_get_team_size_8
+            integer (4) :: omp_get_team_size_8
           end function omp_get_team_size_8
         end interface
 
         interface
           function omp_get_active_level ()
             use omp_lib_kinds
-            integer (omp_integer_kind) :: omp_get_active_level
+            integer (4) :: omp_get_active_level
           end function omp_get_active_level
         end interface
 
+        interface
+          function omp_in_final ()
+            use omp_lib_kinds
+            logical (4) :: omp_in_final
+          end function omp_in_final
+        end interface
+
       end module omp_lib
--- libgomp/fortran.c.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/fortran.c	2011-02-24 15:26:31.000000000 +0100
@@ -1,4 +1,4 @@ 
-/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
    This file is part of the GNU OpenMP Library (libgomp).
@@ -68,6 +68,7 @@  ialias_redirect (omp_get_level)
 ialias_redirect (omp_get_ancestor_thread_num)
 ialias_redirect (omp_get_team_size)
 ialias_redirect (omp_get_active_level)
+ialias_redirect (omp_in_final)
 #endif
 
 #ifndef LIBGOMP_GNU_SYMBOL_VERSIONING
@@ -425,3 +426,9 @@  omp_get_active_level_ (void)
 {
   return omp_get_active_level ();
 }
+
+int32_t
+omp_in_final_ (void)
+{
+  return omp_in_final ();
+}
--- libgomp/omp_lib.h.in.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/omp_lib.h.in	2011-02-24 15:18:23.000000000 +0100
@@ -1,4 +1,4 @@ 
-!  Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+!  Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
 !  Contributed by Jakub Jelinek <jakub@redhat.com>.
 
 !  This file is part of the GNU OpenMP Library (libgomp).
@@ -23,11 +23,12 @@ 
 !  <http://www.gnu.org/licenses/>.
 
       integer omp_lock_kind, omp_nest_lock_kind, openmp_version
-      integer omp_sched_kind, omp_sched_static, omp_sched_dynamic
-      integer omp_sched_guided, omp_sched_auto
       parameter (omp_lock_kind = @OMP_LOCK_KIND@)
       parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@)
+      integer omp_sched_kind
       parameter (omp_sched_kind = 4)
+      integer (omp_sched_kind) omp_sched_static, omp_sched_dynamic
+      integer (omp_sched_kind) omp_sched_guided, omp_sched_auto
       parameter (omp_sched_static = 1)
       parameter (omp_sched_dynamic = 2)
       parameter (omp_sched_guided = 3)
@@ -64,3 +65,6 @@ 
       integer(4) omp_get_thread_limit, omp_get_max_active_levels
       integer(4) omp_get_level, omp_get_ancestor_thread_num
       integer(4) omp_get_team_size, omp_get_active_level
+
+      external omp_in_final
+      logical(4) omp_in_final
--- libgomp/task.c.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/task.c	2011-02-24 15:28:41.000000000 +0100
@@ -1,4 +1,4 @@ 
-/* Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU OpenMP Library (libgomp).
@@ -362,3 +362,11 @@  GOMP_taskwait (void)
 	}
     }
 }
+
+int
+omp_in_final (void)
+{
+  return false; /* FIXME */
+}
+
+ialias (omp_in_final)
--- libgomp/libgomp.map.jj	2011-02-24 14:11:10.000000000 +0100
+++ libgomp/libgomp.map	2011-02-24 15:30:06.000000000 +0100
@@ -107,6 +107,12 @@  OMP_3.0 {
 	omp_unset_nest_lock_;
 } OMP_2.0;
 
+OMP_3.1 {
+  global:
+	omp_in_final;
+	omp_in_final_;
+} OMP_3.0;
+
 GOMP_1.0 {
   global:
 	GOMP_atomic_end;