[Openmp-commits] [openmp] r322621 - [OMPT] Rename ompt_mutex_impl_t to kmp_mutex_impl
Joachim Protze via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 17 02:06:01 PST 2018
Author: jprotze
Date: Wed Jan 17 02:06:01 2018
New Revision: 322621
URL: http://llvm.org/viewvc/llvm-project?rev=322621&view=rev
Log:
[OMPT] Rename ompt_mutex_impl_t to kmp_mutex_impl
The defintion is not part of the spec and thus should not have the prefix
"ompt_" but rather a prefix that indicates that this is implementation
specific.
Differential Revision: https://reviews.llvm.org/D41166
Modified:
openmp/trunk/runtime/src/include/50/ompt.h.var
openmp/trunk/runtime/src/kmp_atomic.h
openmp/trunk/runtime/src/kmp_csupport.cpp
openmp/trunk/runtime/src/ompt-general.cpp
Modified: openmp/trunk/runtime/src/include/50/ompt.h.var
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/include/50/ompt.h.var?rev=322621&r1=322620&r2=322621&view=diff
==============================================================================
--- openmp/trunk/runtime/src/include/50/ompt.h.var (original)
+++ openmp/trunk/runtime/src/include/50/ompt.h.var Wed Jan 17 02:06:01 2018
@@ -84,11 +84,11 @@
/* implementation-specific states (512..) */
-#define FOREACH_OMPT_MUTEX_IMPL(macro) \
- macro (ompt_mutex_impl_unknown, 0) /* unknown implementatin */ \
- macro (ompt_mutex_impl_spin, 1) /* based on spin */ \
- macro (ompt_mutex_impl_queuing, 2) /* based on some fair policy */ \
- macro (ompt_mutex_impl_speculative, 3) /* based on HW-supported speculation */
+#define FOREACH_KMP_MUTEX_IMPL(macro) \
+ macro (ompt_mutex_impl_unknown, 0) /* unknown implementation */ \
+ macro (kmp_mutex_impl_spin, 1) /* based on spin */ \
+ macro (kmp_mutex_impl_queuing, 2) /* based on some fair policy */ \
+ macro (kmp_mutex_impl_speculative, 3) /* based on HW-supported speculation */
#define FOREACH_OMPT_EVENT(macro) \
\
@@ -237,11 +237,11 @@ typedef enum ompt_set_result_t {
/*----------------------
* mutex implementations
*----------------------*/
-typedef enum ompt_mutex_impl_t {
-#define ompt_mutex_impl_macro(impl, code) impl = code,
- FOREACH_OMPT_MUTEX_IMPL(ompt_mutex_impl_macro)
-#undef ompt_mutex_impl_macro
-} ompt_mutex_impl_t;
+typedef enum kmp_mutex_impl_t {
+#define kmp_mutex_impl_macro(impl, code) impl = code,
+ FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro)
+#undef kmp_mutex_impl_macro
+} kmp_mutex_impl_t;
/*****************************************************************************
Modified: openmp/trunk/runtime/src/kmp_atomic.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_atomic.h?rev=322621&r1=322620&r2=322621&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_atomic.h (original)
+++ openmp/trunk/runtime/src/kmp_atomic.h Wed Jan 17 02:06:01 2018
@@ -364,7 +364,7 @@ static inline void __kmp_acquire_atomic_
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
- ompt_mutex_atomic, 0, ompt_mutex_impl_queuing, (ompt_wait_id_t)lck,
+ ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)lck,
OMPT_GET_RETURN_ADDRESS(0));
}
#endif
Modified: openmp/trunk/runtime/src/kmp_csupport.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.cpp?rev=322621&r1=322620&r2=322621&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.cpp (original)
+++ openmp/trunk/runtime/src/kmp_csupport.cpp Wed Jan 17 02:06:01 2018
@@ -829,7 +829,7 @@ void __kmpc_ordered(ident_t *loc, kmp_in
codeptr_ra = OMPT_LOAD_RETURN_ADDRESS(gtid);
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
- ompt_mutex_ordered, omp_lock_hint_none, ompt_mutex_impl_spin,
+ ompt_mutex_ordered, omp_lock_hint_none, kmp_mutex_impl_spin,
(ompt_wait_id_t)lck, codeptr_ra);
}
}
@@ -1247,7 +1247,7 @@ static __forceinline kmp_dyna_lockseq_t
}
#if OMPT_SUPPORT && OMPT_OPTIONAL
-static ompt_mutex_impl_t
+static kmp_mutex_impl_t
__ompt_get_mutex_impl_type(void *user_lock, kmp_indirect_lock_t *ilock = 0) {
if (user_lock) {
switch (KMP_EXTRACT_D_TAG(user_lock)) {
@@ -1255,16 +1255,16 @@ __ompt_get_mutex_impl_type(void *user_lo
break;
#if KMP_USE_FUTEX
case locktag_futex:
- return ompt_mutex_impl_queuing;
+ return kmp_mutex_impl_queuing;
#endif
case locktag_tas:
- return ompt_mutex_impl_spin;
+ return kmp_mutex_impl_spin;
#if KMP_USE_TSX
case locktag_hle:
- return ompt_mutex_impl_speculative;
+ return kmp_mutex_impl_speculative;
#endif
default:
- return ompt_mutex_impl_unknown;
+ return kmp_mutex_impl_unknown;
}
ilock = KMP_LOOKUP_I_LOCK(user_lock);
}
@@ -1273,10 +1273,10 @@ __ompt_get_mutex_impl_type(void *user_lo
#if KMP_USE_TSX
case locktag_adaptive:
case locktag_rtm:
- return ompt_mutex_impl_speculative;
+ return kmp_mutex_impl_speculative;
#endif
case locktag_nested_tas:
- return ompt_mutex_impl_spin;
+ return kmp_mutex_impl_spin;
#if KMP_USE_FUTEX
case locktag_nested_futex:
#endif
@@ -1286,32 +1286,32 @@ __ompt_get_mutex_impl_type(void *user_lo
case locktag_nested_ticket:
case locktag_nested_queuing:
case locktag_nested_drdpa:
- return ompt_mutex_impl_queuing;
+ return kmp_mutex_impl_queuing;
default:
- return ompt_mutex_impl_unknown;
+ return kmp_mutex_impl_unknown;
}
}
// For locks without dynamic binding
-static ompt_mutex_impl_t __ompt_get_mutex_impl_type() {
+static kmp_mutex_impl_t __ompt_get_mutex_impl_type() {
switch (__kmp_user_lock_kind) {
case lk_tas:
- return ompt_mutex_impl_spin;
+ return kmp_mutex_impl_spin;
#if KMP_USE_FUTEX
case lk_futex:
#endif
case lk_ticket:
case lk_queuing:
case lk_drdpa:
- return ompt_mutex_impl_queuing;
+ return kmp_mutex_impl_queuing;
#if KMP_USE_TSX
case lk_hle:
case lk_rtm:
case lk_adaptive:
- return ompt_mutex_impl_speculative;
+ return kmp_mutex_impl_speculative;
#endif
default:
- return ompt_mutex_impl_unknown;
+ return kmp_mutex_impl_unknown;
}
}
#endif
Modified: openmp/trunk/runtime/src/ompt-general.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/ompt-general.cpp?rev=322621&r1=322620&r2=322621&view=diff
==============================================================================
--- openmp/trunk/runtime/src/ompt-general.cpp (original)
+++ openmp/trunk/runtime/src/ompt-general.cpp Wed Jan 17 02:06:01 2018
@@ -44,8 +44,8 @@ typedef struct {
typedef struct {
const char *name;
- ompt_mutex_impl_t id;
-} ompt_mutex_impl_info_t;
+ kmp_mutex_impl_t id;
+} kmp_mutex_impl_info_t;
enum tool_setting_e {
omp_tool_error,
@@ -66,10 +66,10 @@ omp_state_info_t omp_state_info[] = {
#undef omp_state_macro
};
-ompt_mutex_impl_info_t ompt_mutex_impl_info[] = {
-#define ompt_mutex_impl_macro(name, id) {#name, name},
- FOREACH_OMPT_MUTEX_IMPL(ompt_mutex_impl_macro)
-#undef ompt_mutex_impl_macro
+kmp_mutex_impl_info_t kmp_mutex_impl_info[] = {
+#define kmp_mutex_impl_macro(name, id) {#name, name},
+ FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro)
+#undef kmp_mutex_impl_macro
};
ompt_callbacks_internal_t ompt_callbacks;
@@ -387,13 +387,13 @@ OMPT_API_ROUTINE int ompt_enumerate_mute
int *next_impl,
const char **next_impl_name) {
const static int len =
- sizeof(ompt_mutex_impl_info) / sizeof(ompt_mutex_impl_info_t);
+ sizeof(kmp_mutex_impl_info) / sizeof(kmp_mutex_impl_info_t);
int i = 0;
for (i = 0; i < len - 1; i++) {
- if (ompt_mutex_impl_info[i].id != current_impl)
+ if (kmp_mutex_impl_info[i].id != current_impl)
continue;
- *next_impl = ompt_mutex_impl_info[i + 1].id;
- *next_impl_name = ompt_mutex_impl_info[i + 1].name;
+ *next_impl = kmp_mutex_impl_info[i + 1].id;
+ *next_impl_name = kmp_mutex_impl_info[i + 1].name;
return 1;
}
return 0;
More information about the Openmp-commits
mailing list