[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:49 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();
+
+    // Write data to profiling file
+    if (auto Err = ProfOrErr->write()) {
+      consumeError(std::move(Err));
----------------
jdoerfert wrote:

return this error, or at least report it.

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


More information about the cfe-commits mailing list