Standardize how pointer addresses are printed in xla pattern matcher across operating systems.

PiperOrigin-RevId: 300689612
Change-Id: I2a8258ade4b0a1603e05efcb9a765f30449c0bc1
This commit is contained in:
Gunhan Gulsoy 2020-03-12 21:57:23 -07:00 committed by TensorFlower Gardener
parent b1db193e18
commit 7318ae7bea

View File

@ -1187,15 +1187,19 @@ class HloInstructionIsImpl {
bool Match(const ::xla::HloInstruction* inst, MatchOption option) const {
if (inst != inst_) {
EXPLAIN << "HloInstruction " << inst << " is not " << inst_ << " ("
<< InstToString(inst_) << ")";
EXPLAIN << "HloInstruction " << std::hex << std::nouppercase
<< std::showbase << reinterpret_cast<uint64>(inst) << " is not "
<< reinterpret_cast<uint64>(inst_) << " (" << InstToString(inst_)
<< ")";
return false;
}
return true;
}
void DescribeTo(std::ostream* os, int64 indent = 0) const {
*os << "which is " << inst_ << " (" << InstToString(inst_) << ")";
*os << "which is " << std::hex << std::nouppercase << std::showbase
<< reinterpret_cast<uint64>(inst_) << " (" << InstToString(inst_)
<< ")";
}
private: