From 2c295c4e53f7d6712819251685b3410869bb1c7f Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Wed, 23 Dec 2015 02:34:03 +0000 Subject: Fix build error: OMPT_SUPPORT=true was not tested after hinted lock changes Recent changes to support dynamic locks didn't consider the code compiled when OMPT_SUPPORT=true. As a result, the OMPT support was broken by recent changes to nested locks to support dynamic locks. For OMPT to work with dynamic locks, they need to provide a return code indicating whether a nested lock acquisition was the first or not. This patch moves the OMPT support for nested locks into the #else case when DYNAMIC locks were not used. New support is needed for dynamic locks. This patch fixes the build and leaves a placeholder where the missing OMPT callbacks can be added either the author of the OMPT support for locks, or the dynamic locking support. Patch by John Mellor-Crummey Differential Revision: http://reviews.llvm.org/D15656 llvm-svn: 256314 --- openmp/runtime/src/kmp_csupport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openmp/runtime') diff --git a/openmp/runtime/src/kmp_csupport.c b/openmp/runtime/src/kmp_csupport.c index e44886facdf..905f596c964 100644 --- a/openmp/runtime/src/kmp_csupport.c +++ b/openmp/runtime/src/kmp_csupport.c @@ -2202,6 +2202,12 @@ __kmpc_set_nest_lock( ident_t * loc, kmp_int32 gtid, void ** user_lock ) { __kmp_itt_lock_acquired((kmp_user_lock_p)user_lock); #endif +#if OMPT_SUPPORT && OMPT_TRACE + if (ompt_enabled) { + // missing support here: need to know whether acquired first or not + } +#endif + #else // KMP_USE_DYNAMIC_LOCK int acquire_status; kmp_user_lock_p lck; @@ -2230,7 +2236,6 @@ __kmpc_set_nest_lock( ident_t * loc, kmp_int32 gtid, void ** user_lock ) { #if USE_ITT_BUILD __kmp_itt_lock_acquired( lck ); #endif /* USE_ITT_BUILD */ -#endif // KMP_USE_DYNAMIC_LOCK #if OMPT_SUPPORT && OMPT_TRACE if (ompt_enabled) { @@ -2243,6 +2248,8 @@ __kmpc_set_nest_lock( ident_t * loc, kmp_int32 gtid, void ** user_lock ) { } } #endif + +#endif // KMP_USE_DYNAMIC_LOCK } void -- cgit v1.2.3