Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion onnxruntime/test/perftest/posix/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ namespace utils {
std::size_t GetPeakWorkingSetSize() {
struct rusage rusage;
getrusage(RUSAGE_SELF, &rusage);
return static_cast<size_t>(rusage.ru_maxrss * 1024L);

#if defined(__APPLE__)
constexpr size_t kBytesPerMaxRssUnit = 1;
#else
constexpr size_t kBytesPerMaxRssUnit = 1024;
#endif

return static_cast<size_t>(rusage.ru_maxrss) * kBytesPerMaxRssUnit;
}

class CPUUsage : public ICPUUsage {
Expand Down
Loading