From 2eee9b8350fd370f16dd30c38406b4954e472f1b Mon Sep 17 00:00:00 2001 From: Emery Berger Date: Mon, 7 Feb 2022 13:22:07 -0500 Subject: [PATCH] Adding GPU memory profiling. --- scalene/scalene-gui/scalene-gui.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scalene/scalene-gui/scalene-gui.js b/scalene/scalene-gui/scalene-gui.js index af6e87d96..f2617eeb1 100644 --- a/scalene/scalene-gui/scalene-gui.js +++ b/scalene/scalene-gui/scalene-gui.js @@ -137,7 +137,8 @@ function makeTableHeader(fname, gpu, memory, functions = false) { { title: ["copy", "(MB/s)"], color: CopyColor, width: 0 }]); } if (gpu) { - columns.push({ title: ["gpu", ""], color: CopyColor, width: 0 }); + columns.push({ title: ["gpu", "time"], color: CopyColor, width: 0 }); + columns.push({ title: ["gpu", "peak MB"], color: CopyColor, width: 0 }); } columns.push({ title: ["", ""], color: "black", width: 100 }); let s = ''; @@ -202,7 +203,12 @@ function makeProfileLine(line, prof, cpu_bars, memory_bars, memory_sparklines) { if (line.n_gpu_percent < 1.0) { s += ''; } else { - s += `${line.n_gpu_percent.toFixed(0)}`; + s += `${line.n_gpu_percent.toFixed(0)}%`; + } + if (line.n_gpu_avg_memory < 1.0) { + s += ''; + } else { + s += `${line.n_gpu_avg_memory.toFixed(0)}MB`; } } s += `${line.lineno} `;