[Mlir-commits] [mlir] [MLIR][NVVM] Add binaryCallback (PR #170853)
Mehdi Amini
llvmlistbot at llvm.org
Mon Dec 8 07:14:31 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:
The whole debug from below should likely move here, most of the code is duplicated. I suspect we only need a single line:
```suggestion
binaryCallback(logRef);
LDBG("serialize-to-binary") << logRef;
```
https://github.com/llvm/llvm-project/pull/170853
More information about the Mlir-commits
mailing list