summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/ompt-general.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp
index c1e8b0f22eb..9f21214f808 100644
--- a/openmp/runtime/src/ompt-general.cpp
+++ b/openmp/runtime/src/ompt-general.cpp
@@ -411,9 +411,12 @@ OMPT_API_ROUTINE int ompt_set_callback(ompt_callbacks_t which,
case event_name: \
if (ompt_event_implementation_status(event_name)) { \
ompt_callbacks.ompt_callback(event_name) = (callback_type)callback; \
- ompt_enabled.event_name = 1; \
+ ompt_enabled.event_name = (callback != 0); \
} \
- return ompt_event_implementation_status(event_name);
+ if (callback) \
+ return ompt_event_implementation_status(event_name); \
+ else \
+ return ompt_set_always;
FOREACH_OMPT_EVENT(ompt_event_macro)
OpenPOWER on IntegriCloud