[Openmp-commits] [PATCH] D41817: [OMPT] Enable OMPT on 32-bit ARM machines
Paul Osmialowski via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 10 08:19:20 PST 2018
pawosm01 added a comment.
Guys, I can think of approach as follows, but fixing all relevant lit tests to make FileCheck directives aware of relevant architecture+compiler combinations is beyond my imagination:
diff --git a/runtime/src/kmp_gsupport.cpp b/runtime/src/kmp_gsupport.cpp
index 9fa05e6..d696d4a 100644
--- a/runtime/src/kmp_gsupport.cpp
+++ b/runtime/src/kmp_gsupport.cpp
@@ -15,8 +15,18 @@
#include "kmp_atomic.h"
#if OMPT_SUPPORT
-#include "ompt-specific.h"
+
+#if KMP_ARCH_ARM
+#ifndef OMPT_GET_FRAME_ADDRESS
+#error OMPT_GET_FRAME_ADDRESS should be defined after the inclusion of kmp.h
#endif
+#undef OMPT_GET_FRAME_ADDRESS
+#define OMPT_GET_FRAME_ADDRESS(level) NULL
+#endif // KMP_ARCH_ARM
+
+#include "ompt-specific.h"
+
+#endif // OMPT_SUPPORT
#ifdef __cplusplus
extern "C" {
diff --git a/runtime/src/ompt-internal.h b/runtime/src/ompt-internal.h
index 6139e00..041fabf 100644
--- a/runtime/src/ompt-internal.h
+++ b/runtime/src/ompt-internal.h
@@ -93,7 +93,11 @@ void ompt_post_init(void);
void ompt_fini(void);
#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
+#if KMP_ARCH_ARM && KMP_COMPILER_GCC
+#define OMPT_GET_FRAME_ADDRESS(level) NULL
+#else
#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
+#endif
int __kmp_control_tool(uint64_t command, uint64_t modifier, void *arg);
diff --git a/runtime/test/ompt/callback.h b/runtime/test/ompt/callback.h
index 3befe7c..559172d 100755
--- a/runtime/test/ompt/callback.h
+++ b/runtime/test/ompt/callback.h
@@ -61,9 +61,15 @@ static void print_ids(int level)
printf("%" PRIu64 ": task level %d: parallel_id=%" PRIu64 ", task_id=%" PRIu64 ", frame=%p\n", ompt_get_thread_data()->value, level, exists_task ? parallel_data->value : 0, exists_task ? task_data->value : 0, frame);
}
+#if KMP_ARCH_ARM && KMP_COMPILER_GCC
+#define frame_address(level) NULL
+#else
+#define frame_address(level) __builtin_frame_address(level)
+#endif
+
#define print_frame(level)\
do {\
- printf("%" PRIu64 ": __builtin_frame_address(%d)=%p\n", ompt_get_thread_data()->value, level, __builtin_frame_address(level));\
+ printf("%" PRIu64 ": __builtin_frame_address(%d)=%p\n", ompt_get_thread_data()->value, level, frame_address(level));\
} while(0)
// clang (version 5.0 and above) adds an intermediate function call with debug flag (-g)
Repository:
rOMP OpenMP
https://reviews.llvm.org/D41817
More information about the Openmp-commits
mailing list