From 84d9328d8496c2086e1412f61c18f7e55834a7a3 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Fri, 24 Feb 2023 10:20:03 +0100 Subject: [PATCH] GpuMemDumpVis.py: Fixed division by zero error when only custom pools are used --- tools/GpuMemDumpVis/GpuMemDumpVis.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/GpuMemDumpVis/GpuMemDumpVis.py b/tools/GpuMemDumpVis/GpuMemDumpVis.py index c4ab206..e16397e 100644 --- a/tools/GpuMemDumpVis/GpuMemDumpVis.py +++ b/tools/GpuMemDumpVis/GpuMemDumpVis.py @@ -81,16 +81,17 @@ def IsDataEmpty(): def RemoveEmptyType(): global data for poolType in list(data.keys()): - if len(data[poolType]['DedicatedAllocations']) > 0: + pool = data[poolType] + if len(pool['DedicatedAllocations']) > 0: continue - if len(data[poolType]['Blocks']) > 0: + if len(pool['Blocks']) > 0: continue empty = True - for customPool in data[poolType]['CustomPools'].values(): - if len(data[poolType]['Blocks']) > 0: + for customPool in pool['CustomPools'].values(): + if len(customPool['Blocks']) > 0: empty = False break - if len(data[poolType]['DedicatedAllocations']) > 0: + if len(customPool['DedicatedAllocations']) > 0: empty = False break if empty: