summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/ompt-specific.h
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/ompt-specific.h')
-rw-r--r--openmp/runtime/src/ompt-specific.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/openmp/runtime/src/ompt-specific.h b/openmp/runtime/src/ompt-specific.h
index 47d8a166984..5ba240c1a95 100644
--- a/openmp/runtime/src/ompt-specific.h
+++ b/openmp/runtime/src/ompt-specific.h
@@ -15,6 +15,7 @@
#include "kmp.h"
+#if OMPT_SUPPORT
/*****************************************************************************
* forward declarations
****************************************************************************/
@@ -101,5 +102,30 @@ inline void ompt_set_thread_state(kmp_info_t *thread, ompt_state_t state) {
inline const char *ompt_get_runtime_version() {
return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
}
+#endif // OMPT_SUPPRORT
+
+// macros providing the OMPT callbacks for reduction clause
+#if OMPT_SUPPORT && OMPT_OPTIONAL
+#define OMPT_REDUCTION_DECL(this_thr, gtid) \
+ ompt_data_t *my_task_data = OMPT_CUR_TASK_DATA(this_thr); \
+ ompt_data_t *my_parallel_data = OMPT_CUR_TEAM_DATA(this_thr); \
+ void *return_address = OMPT_LOAD_RETURN_ADDRESS(gtid);
+#define OMPT_REDUCTION_BEGIN \
+ if (ompt_enabled.enabled && ompt_enabled.ompt_callback_reduction) { \
+ ompt_callbacks.ompt_callback(ompt_callback_reduction)( \
+ ompt_sync_region_reduction, ompt_scope_begin, my_parallel_data, \
+ my_task_data, return_address); \
+ }
+#define OMPT_REDUCTION_END \
+ if (ompt_enabled.enabled && ompt_enabled.ompt_callback_reduction) { \
+ ompt_callbacks.ompt_callback(ompt_callback_reduction)( \
+ ompt_sync_region_reduction, ompt_scope_end, my_parallel_data, \
+ my_task_data, return_address); \
+ }
+#else // OMPT_SUPPORT && OMPT_OPTIONAL
+#define OMPT_REDUCTION_DECL(this_thr, gtid)
+#define OMPT_REDUCTION_BEGIN
+#define OMPT_REDUCTION_END
+#endif // ! OMPT_SUPPORT && OMPT_OPTIONAL
#endif
OpenPOWER on IntegriCloud