libomp: Add omp_depend_kind to omp_lib.{f90,h}
authorTobias Burnus <tobias@codesourcery.com>
Thu, 23 Jul 2020 13:02:15 +0000 (15:02 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Thu, 23 Jul 2020 13:02:15 +0000 (15:02 +0200)
gcc/fortran/ChangeLog:

* intrinsic.texi (OMP_LIB_KINDS): Add omp_depend_kind.

libgomp/ChangeLog:

* configure.ac: Add OMP_DEPEND_KIND and OMP_INT128_SIZE.
* libgomp_f.h.in (omp_check_defines): Check whether
sizeof of determined Fortran kind and C typedef match.
* omp_lib.f90.in: Add omp_depened_kind.
* omp_lib.h.in: Likewise; fix omp_alloctrait_key_kind.
* configure: Regenerate.
* Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

gcc/fortran/intrinsic.texi
libgomp/Makefile.in
libgomp/configure
libgomp/configure.ac
libgomp/libgomp_f.h.in
libgomp/omp_lib.f90.in
libgomp/omp_lib.h.in
libgomp/testsuite/Makefile.in

index 1b93d251509a7bef0286d6d75660a1b740a65f06..6268feca70cd9067ada65b7bd28f7aa4523f766f 100644 (file)
@@ -15317,6 +15317,7 @@ named constants:
 @item @code{omp_allocator_handle_kind}
 @item @code{omp_alloctrait_key_kind}
 @item @code{omp_alloctrait_val_kind}
+@item @code{omp_depend_kind}
 @item @code{omp_lock_kind}
 @item @code{omp_lock_hint_kind}
 @item @code{omp_nest_lock_kind}
index bc044b1820ae727f60db72aa3cc61c01545b87c8..8418af977d48b4756ab540ab82317998326d2c28 100644 (file)
@@ -421,6 +421,7 @@ NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OMP_DEPEND_KIND = @OMP_DEPEND_KIND@
 OMP_LOCK_25_ALIGN = @OMP_LOCK_25_ALIGN@
 OMP_LOCK_25_KIND = @OMP_LOCK_25_KIND@
 OMP_LOCK_25_SIZE = @OMP_LOCK_25_SIZE@
index d85023f4f05957a96b3b2a366918df19622682e4..937d5d6a591e2464ce2de65fdfe0824dd7e1e0f8 100755 (executable)
@@ -635,6 +635,7 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 get_gcc_base_ver
+OMP_DEPEND_KIND
 OMP_NEST_LOCK_25_KIND
 OMP_LOCK_25_KIND
 OMP_NEST_LOCK_25_ALIGN
@@ -11434,7 +11435,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11437 "configure"
+#line 11438 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11540,7 +11541,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11543 "configure"
+#line 11544 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16968,6 +16969,20 @@ if ac_fn_c_compute_int "$LINENO" "sizeof (__INTPTR_TYPE__)" "INTPTR_T_KIND"
 fi
 
 
+if ac_fn_c_compute_int "$LINENO" "sizeof (__int128)" "OMP_INT128_SIZE"        ""; then :
+
+else
+  OMP_INT128_SIZE=0
+fi
+
+
+if ac_fn_c_compute_int "$LINENO" "2*sizeof (__INTPTR_TYPE__)" "OMP_DEPEND_KIND"        ""; then :
+
+else
+  OMP_DEPEND_KIND=0
+fi
+
+
 if ac_fn_c_compute_int "$LINENO" "sizeof (omp_lock_t)" "OMP_LOCK_SIZE"        ""; then :
 
 else
 if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
   OMP_NEST_LOCK_25_KIND=8
 fi
+if test $OMP_DEPEND_KIND -eq 16; then
+  if test $OMP_INT128_SIZE -ne 16; then
+    as_fn_error $? "unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind" "$LINENO" 5
+  fi
+else
+  if test $OMP_DEPEND_KIND -ne 8; then
+    as_fn_error $? "unsupported system, cannot find Fortran integer kind for omp_depend_kind" "$LINENO" 5
+  fi
+fi
+
 
 
 
index d1034dab7f80e7da0ed270754288bc3fe7593688..e4f30cbb0829814b935f8f54c7d44daab2561b30 100644 (file)
@@ -396,6 +396,9 @@ for i in $config_path; do
 done
 
 _AC_COMPUTE_INT([sizeof (__INTPTR_TYPE__)], [INTPTR_T_KIND])
+_AC_COMPUTE_INT([sizeof (__int128)], [OMP_INT128_SIZE],,[OMP_INT128_SIZE=0])
+_AC_COMPUTE_INT([2*sizeof (__INTPTR_TYPE__)], [OMP_DEPEND_KIND],,
+               [OMP_DEPEND_KIND=0])
 _AC_COMPUTE_INT([sizeof (omp_lock_t)], [OMP_LOCK_SIZE],,
   [AC_MSG_ERROR([unsupported system, cannot find sizeof (omp_lock_t)])])
 _AC_COMPUTE_INT([__alignof (omp_lock_t)], [OMP_LOCK_ALIGN])
@@ -428,6 +431,15 @@ fi
 if test $OMP_NEST_LOCK_25_SIZE -gt 8 || test $OMP_NEST_LOCK_25_ALIGN -gt $OMP_NEST_LOCK_25_SIZE; then
   OMP_NEST_LOCK_25_KIND=8
 fi
+if test $OMP_DEPEND_KIND -eq 16; then
+  if test $OMP_INT128_SIZE -ne 16; then
+    AC_MSG_ERROR([unsupported system, cannot find Fortran int kind=16, needed for omp_depend_kind])
+  fi
+else
+  if test $OMP_DEPEND_KIND -ne 8; then
+    AC_MSG_ERROR([unsupported system, cannot find Fortran integer kind for omp_depend_kind])
+  fi
+fi
 
 AC_SUBST(INTPTR_T_KIND)
 AC_SUBST(OMP_LOCK_SIZE)
@@ -442,6 +454,7 @@ AC_SUBST(OMP_NEST_LOCK_25_SIZE)
 AC_SUBST(OMP_NEST_LOCK_25_ALIGN)
 AC_SUBST(OMP_LOCK_25_KIND)
 AC_SUBST(OMP_NEST_LOCK_25_KIND)
+AC_SUBST(OMP_DEPEND_KIND)
 CFLAGS="$save_CFLAGS"
 
 # Determine what GCC version number to use in filesystem paths.
index 3359352a0b4b1e23ec374c2b669cbb5e62cb3948..d629503b8da389da2e5e49c43a895b41e138ce3c 100644 (file)
@@ -79,7 +79,12 @@ omp_check_defines (void)
             || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
             || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
             || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
-            || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0))
+            || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0)
+            || @INTPTR_T_KIND@ != sizeof (omp_allocator_handle_t)
+            || 4 != sizeof (omp_alloctrait_key_t)
+            || @INTPTR_T_KIND@ != sizeof (omp_alloctrait_value_t)
+            || @INTPTR_T_KIND@ != sizeof (omp_memspace_handle_t)
+            || @OMP_DEPEND_KIND@ != sizeof (omp_depend_t))
            ? -1 : 1] __attribute__ ((__unused__));
   char test2[(@OMP_LOCK_25_SIZE@ != sizeof (omp_lock_25_t)
             || @OMP_LOCK_25_ALIGN@ != __alignof (omp_lock_25_t)
index b22bcbaf77013559cfe1b99fc6901d75da3ded44..3ec31ac1f1ff8996f06bd7e68bd46de768f40cae 100644 (file)
@@ -38,6 +38,7 @@
         integer, parameter :: omp_alloctrait_key_kind = c_int
         integer, parameter :: omp_alloctrait_val_kind = c_intptr_t
         integer, parameter :: omp_memspace_handle_kind = c_intptr_t
+        integer, parameter :: omp_depend_kind = @OMP_DEPEND_KIND@
         integer (omp_sched_kind), parameter :: omp_sched_static = 1
         integer (omp_sched_kind), parameter :: omp_sched_dynamic = 2
         integer (omp_sched_kind), parameter :: omp_sched_guided = 3
index c7d444d4a97f73d79241ccf514ed55b6cabcfcae..26dbe03a629b912e6b3f9b6cffd745aac2c2b445 100644 (file)
@@ -26,6 +26,8 @@
       integer omp_lock_kind, omp_nest_lock_kind, openmp_version
       parameter (omp_lock_kind = @OMP_LOCK_KIND@)
       parameter (omp_nest_lock_kind = @OMP_NEST_LOCK_KIND@)
+      integer omp_depend_kind
+      parameter (omp_depend_kind = @OMP_DEPEND_KIND@)
       integer omp_sched_kind
       parameter (omp_sched_kind = 4)
       integer (omp_sched_kind) omp_sched_static, omp_sched_dynamic
@@ -81,7 +83,7 @@
       integer omp_allocator_handle_kind, omp_alloctrait_key_kind
       integer omp_alloctrait_val_kind, omp_memspace_handle_kind
       parameter (omp_allocator_handle_kind = @INTPTR_T_KIND@)
-      parameter (omp_alloctrait_key_kind = @INTPTR_T_KIND@)
+      parameter (omp_alloctrait_key_kind = 4)
       parameter (omp_alloctrait_val_kind = @INTPTR_T_KIND@)
       parameter (omp_memspace_handle_kind = @INTPTR_T_KIND@)
       integer (omp_alloctrait_key_kind) omp_atk_sync_hint
index bbec6aeca00b43101e79369d34e8e128a85f4054..58ba1f319b0739d107ba3248e6defe42103401cf 100644 (file)
@@ -186,6 +186,7 @@ NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OMP_DEPEND_KIND = @OMP_DEPEND_KIND@
 OMP_LOCK_25_ALIGN = @OMP_LOCK_25_ALIGN@
 OMP_LOCK_25_KIND = @OMP_LOCK_25_KIND@
 OMP_LOCK_25_SIZE = @OMP_LOCK_25_SIZE@