[Openmp-commits] [openmp] r321831 - Fix some comments and formatting in kmp_dispatch.cpp

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 4 15:05:26 PST 2018


Author: jlpeyton
Date: Thu Jan  4 15:05:26 2018
New Revision: 321831

URL: http://llvm.org/viewvc/llvm-project?rev=321831&view=rev
Log:
Fix some comments and formatting in kmp_dispatch.cpp

Modified:
    openmp/trunk/runtime/src/kmp_dispatch.cpp

Modified: openmp/trunk/runtime/src/kmp_dispatch.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_dispatch.cpp?rev=321831&r1=321830&r2=321831&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_dispatch.cpp (original)
+++ openmp/trunk/runtime/src/kmp_dispatch.cpp Thu Jan  4 15:05:26 2018
@@ -234,8 +234,12 @@ __forceinline kmp_int32 compare_and_swap
 /* Spin wait loop that first does pause, then yield.
     Waits until function returns non-zero when called with *spinner and check.
     Does NOT put threads to sleep.
-#if USE_ITT_BUILD
     Arguments:
+        UT is unsigned 4- or 8-byte type
+        spinner - memory location to check value
+        checker - value which spinner is >, <, ==, etc.
+        pred - predicate function to perform binary comparison of some sort
+#if USE_ITT_BUILD
         obj -- is higher-level synchronization object to report to ittnotify.
         It is used to report locks consistently. For example, if lock is
         acquired immediately, its address is reported to ittnotify via
@@ -243,15 +247,12 @@ __forceinline kmp_int32 compare_and_swap
         and lock routine calls to KMP_WAIT_YIELD(), the later should report the
         same address, not an address of low-level spinner.
 #endif // USE_ITT_BUILD
+    TODO: make inline function (move to header file for icl)
 */
 template <typename UT>
-// ToDo: make inline function (move to header file for icl)
-static UT // unsigned 4- or 8-byte type
-    __kmp_wait_yield(
-        volatile UT *spinner, UT checker,
-        kmp_uint32 (*pred)(UT, UT) USE_ITT_BUILD_ARG(
-            void *obj) // Higher-level synchronization object, or NULL.
-        ) {
+static UT __kmp_wait_yield(volatile UT *spinner, UT checker,
+                           kmp_uint32 (*pred)(UT, UT)
+                               USE_ITT_BUILD_ARG(void *obj)) {
   // note: we may not belong to a team at this point
   volatile UT *spin = spinner;
   UT check = checker;




More information about the Openmp-commits mailing list