Skip to content

Commit

Permalink
[OpenMP][OMPT] Fix locking testcases for 32 bit architectures
Browse files Browse the repository at this point in the history
https://reviews.llvm.org/D58454 did not fix the problem for a typical use
case of building LLVM with gcc or icc and then testing with the newly built
clang compiler.
The compilers do not agree on how to extend a 32-bit pointer to uint64, so
make the pointer unsigned first, before adjusting the size.

Patch by Joachim Protze

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

llvm-svn: 361158
  • Loading branch information
jprotze authored and MrSidims committed May 24, 2019
1 parent 0f58bb0 commit b109073
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 67 deletions.
6 changes: 3 additions & 3 deletions openmp/runtime/src/kmp_atomic.h
Expand Up @@ -363,7 +363,7 @@ static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquire) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)lck,
ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)(uintptr_t)lck,
OMPT_GET_RETURN_ADDRESS(0));
}
#endif
Expand All @@ -373,7 +373,7 @@ static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_acquired) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck, OMPT_GET_RETURN_ADDRESS(0));
}
#endif
}
Expand All @@ -389,7 +389,7 @@ static inline void __kmp_release_atomic_lock(kmp_atomic_lock_t *lck,
#if OMPT_SUPPORT && OMPT_OPTIONAL
if (ompt_enabled.ompt_callback_mutex_released) {
ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck, OMPT_GET_RETURN_ADDRESS(0));
}
#endif
}
Expand Down

0 comments on commit b109073

Please sign in to comment.