[Openmp-commits] [PATCH] D42709: [OMPT] Fix tool initialization returning 0

Phabricator via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 6 00:43:19 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL324320: [OMPT] Fix tool initialization returning 0 (authored by jprotze, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D42709?vs=132048&id=132947#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D42709

Files:
  openmp/trunk/runtime/src/ompt-general.cpp


Index: openmp/trunk/runtime/src/ompt-general.cpp
===================================================================
--- openmp/trunk/runtime/src/ompt-general.cpp
+++ openmp/trunk/runtime/src/ompt-general.cpp
@@ -332,6 +332,12 @@
     ompt_enabled.enabled = !!ompt_start_tool_result->initialize(
         ompt_fn_lookup, &(ompt_start_tool_result->tool_data));
 
+    if (!ompt_enabled.enabled) {
+      // tool not enabled, zero out the bitmap, and done
+      memset(&ompt_enabled, 0, sizeof(ompt_enabled));
+      return;
+    }
+
     ompt_thread_t *root_thread = ompt_get_thread();
 
     ompt_set_thread_state(root_thread, omp_state_overhead);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42709.132947.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180206/224d2ac6/attachment.bin>


More information about the Openmp-commits mailing list