[Openmp-commits] [openmp] r278003 - kmp_gsupport: Fix library initialization with taskgroup

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 8 06:23:08 PDT 2016


Author: hahnfeld
Date: Mon Aug  8 08:23:08 2016
New Revision: 278003

URL: http://llvm.org/viewvc/llvm-project?rev=278003&view=rev
Log:
kmp_gsupport: Fix library initialization with taskgroup

Differential Revision: https://reviews.llvm.org/D23259

Added:
    openmp/trunk/runtime/test/tasking/bug_serial_taskgroup.c
Modified:
    openmp/trunk/runtime/src/kmp_gsupport.c

Modified: openmp/trunk/runtime/src/kmp_gsupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_gsupport.c?rev=278003&r1=278002&r2=278003&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_gsupport.c (original)
+++ openmp/trunk/runtime/src/kmp_gsupport.c Mon Aug  8 08:23:08 2016
@@ -1259,7 +1259,7 @@ PARALLEL_LOOP(xexpand(KMP_API_NAME_GOMP_
 void
 xexpand(KMP_API_NAME_GOMP_TASKGROUP_START)(void)
 {
-    int gtid = __kmp_get_gtid();
+    int gtid = __kmp_entry_gtid();
     MKLOC(loc, "GOMP_taskgroup_start");
     KA_TRACE(20, ("GOMP_taskgroup_start: T#%d\n", gtid));
 

Added: openmp/trunk/runtime/test/tasking/bug_serial_taskgroup.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/tasking/bug_serial_taskgroup.c?rev=278003&view=auto
==============================================================================
--- openmp/trunk/runtime/test/tasking/bug_serial_taskgroup.c (added)
+++ openmp/trunk/runtime/test/tasking/bug_serial_taskgroup.c Mon Aug  8 08:23:08 2016
@@ -0,0 +1,16 @@
+// RUN: %libomp-compile-and-run
+
+/*
+ GCC failed this test because __kmp_get_gtid() instead of __kmp_entry_gtid()
+ was called in xexpand(KMP_API_NAME_GOMP_TASKGROUP_START)(void).
+ __kmp_entry_gtid() will initialize the runtime if not yet done which does not
+ happen with __kmp_get_gtid().
+ */
+
+int main()
+{
+    #pragma omp taskgroup
+    { }
+
+    return 0;
+}




More information about the Openmp-commits mailing list