[Mlir-commits] [mlir] [mlir][gpu][nvptx] Remove null terminator when outputting PTX (PR #133019)
Fabian Mora
llvmlistbot at llvm.org
Fri Mar 28 18:29:04 PDT 2025
fabianmcg wrote:
> That's good to know, thanks! I'm thinking then if this is specific to the JIT execution path it may be better to add the null there instead of to the ptx under `gpu::CompilationTarget::Assembly`. WDYT?
I think it's cheaper to just not print the terminator, rather than having to copy the string to add one for the JIT path, you can do that with:
```c++
fileStream << StringRef(ptxData).drop_back();
// Or
fileStream << StringRef(ptxData).consume_back('\0');
```
See Mehdi's comment as well.
https://github.com/llvm/llvm-project/pull/133019
More information about the Mlir-commits
mailing list