[Mlir-commits] [mlir] [MLIR][NVVM] Add binaryCallback (PR #170853)

Mehdi Amini llvmlistbot at llvm.org
Wed Dec 10 03:26:22 PST 2025


================
@@ -521,6 +524,15 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
                                                 /*ErrMsg=*/&message))
     return emitLogError("`fatbinary`");
 
+  if (binaryCallback) {
+    llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> logBuffer =
+        llvm::MemoryBuffer::getFile(logFile->first);
+    if (logBuffer && !(*logBuffer)->getBuffer().empty()) {
+      StringRef logRef = (*logBuffer)->getBuffer();
+      binaryCallback(logRef);
----------------
joker-eph wrote:

Or, if it is some important information, can we store it as a stringAttr metadata in the IR alongside the object?

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


More information about the Mlir-commits mailing list