[Openmp-commits] [llvm] [openmp] [offload] Improve report printing for kernel recording (PR #204505)

Kevin Sala Penades via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 18 11:50:32 PDT 2026


================
@@ -88,20 +88,34 @@ Error RecordReplayTy::deinit() {
 }
 
 Error RecordReplayTy::emitInstanceReport() {
+  llvm::raw_ostream *OutStream = &llvm::outs();
+  std::unique_ptr<llvm::raw_fd_ostream> FileOut;
+
+  if (!ReportFile.empty()) {
+    // The report file is emitted in the output directory.
+    std::string ReportFilePath =
+        (std::filesystem::absolute(OutputDirectory) / ReportFile).string();
+    std::error_code EC;
+    FileOut = std::make_unique<llvm::raw_fd_ostream>(ReportFilePath, EC);
+    if (EC)
+      return Plugin::error(ErrorCode::HOST_IO, "saving report file");
+    OutStream = FileOut.get();
+  }
----------------
kevinsala wrote:

It expects a file name only, not a path, as the the file is created within the output directory (`LIBOMPTARGET_RECORD_DIR`). Do you want it to accept path as well?

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


More information about the Openmp-commits mailing list