[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 26 09:20:50 PDT 2024


================
@@ -829,6 +829,25 @@ Error GenericDeviceTy::deinit(GenericPluginTy &Plugin) {
            DeviceMemoryPoolTracking.AllocationMax);
   }
 
+  for (auto *Image : LoadedImages) {
+    GenericGlobalHandlerTy &Handler = Plugin.getGlobalHandler();
+    if (!Handler.hasProfilingGlobals(*this, *Image))
+      continue;
+
+    GPUProfGlobals profdata;
+    auto ProfOrErr = Handler.readProfilingGlobals(*this, *Image);
+    if (!ProfOrErr)
+      return ProfOrErr.takeError();
+
+    // Dump out profdata
+    ProfOrErr->dump();
----------------
jdoerfert wrote:

Do this only if LIBOMPTARGET_DEBUG is set.

https://github.com/llvm/llvm-project/pull/93365


More information about the cfe-commits mailing list