[Openmp-commits] [PATCH] D124652: [OpenMP] [OMPT] [amdgpu] [5/8] Implemented device init/fini/load callbacks

Dhruva Chakrabarti via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri May 5 09:36:40 PDT 2023


dhruvachak added inline comments.


================
Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h:27
 #include "Utilities.h"
+#include "omp-tools.h"
 #include "omptarget.h"
----------------
Guard it with OMPT_SUPPORT?


================
Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h:753
+
+#ifdef OMPT_SUPPORT
+  /// Callback functions
----------------
So now the size of GenericDeviceTy varies based on whether OMPT support is compiled in or not. I would prefer removing the ifdef here and in the ctor (so that proper init happens) so that the size is the same regardless of cmake config. But I am not requesting this change, would be curious what others feel. I just like it that way since it helps debugging when there is a problem.


================
Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h:760
+  /// Internal representation for OMPT device (initialize & finalize)
+  std::atomic<bool> OmptDevice;
+#endif
----------------
Give it a more meaningful name, it's just an atomic boolean now. Some OMPT APIs require an opaque ompt_device_t. In the previous version, we would pass a handle to OmptDevice for those APIs, so that may have to refactored when the time comes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124652/new/

https://reviews.llvm.org/D124652



More information about the Openmp-commits mailing list