Skip to content

Commit 81a0e05

Browse files
committed
During memory pressure, print with 4 sig figs
1 parent 9460172 commit 81a0e05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scopehal/AcceleratorBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ class AcceleratorBuffer
13291329
LogError(
13301330
"Failed to allocate %s of GPU memory despite our best efforts to reclaim space\n"
13311331
"This is unrecoverable (for now).\n",
1332-
Unit(Unit::UNIT_BYTES).PrettyPrint(req.size).c_str());
1332+
Unit(Unit::UNIT_BYTES).PrettyPrint(req.size, 4).c_str());
13331333
exit(1);
13341334
}
13351335
m_gpuMemoryType = MEM_TYPE_GPU_ONLY;

scopehal/scopehal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ bool OnMemoryPressure(MemoryPressureLevel level, MemoryPressureType type, size_t
10061006
LogWarning("OnMemoryPressure: %s memory exhaustion on %s (tried to allocate %s)\n",
10071007
(level == MemoryPressureLevel::Hard) ? "Hard" : "Soft",
10081008
(type == MemoryPressureType::Host) ? "host" : "device",
1009-
Unit(Unit::UNIT_BYTES).PrettyPrint(requestedSize).c_str());
1009+
Unit(Unit::UNIT_BYTES).PrettyPrint(requestedSize, 4).c_str());
10101010

10111011
bool moreFreed = false;
10121012

0 commit comments

Comments
 (0)