Only log recorded allocations if any bytes were used or requested in a given bucket.
PiperOrigin-RevId: 336275933 Change-Id: I4359695cd5f48c671910259b3b677952a5281803
This commit is contained in:
parent
982ee24e7c
commit
a68af2830a
@ -118,12 +118,14 @@ void RecordingMicroAllocator::PrintRecordedAllocation(
|
|||||||
const char* allocation_description) const {
|
const char* allocation_description) const {
|
||||||
#ifndef TF_LITE_STRIP_ERROR_STRINGS
|
#ifndef TF_LITE_STRIP_ERROR_STRINGS
|
||||||
RecordedAllocation allocation = GetRecordedAllocation(allocation_type);
|
RecordedAllocation allocation = GetRecordedAllocation(allocation_type);
|
||||||
TF_LITE_REPORT_ERROR(
|
if (allocation.used_bytes > 0 || allocation.requested_bytes > 0) {
|
||||||
error_reporter(),
|
TF_LITE_REPORT_ERROR(
|
||||||
"[RecordingMicroAllocator] '%s' used %d bytes with alignment overhead "
|
error_reporter(),
|
||||||
"(requested %d bytes for %d %s)",
|
"[RecordingMicroAllocator] '%s' used %d bytes with alignment overhead "
|
||||||
allocation_name, allocation.used_bytes, allocation.requested_bytes,
|
"(requested %d bytes for %d %s)",
|
||||||
allocation.count, allocation_description);
|
allocation_name, allocation.used_bytes, allocation.requested_bytes,
|
||||||
|
allocation.count, allocation_description);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user