From 70c684170a926afad8898d939bb855b85ee3b070 Mon Sep 17 00:00:00 2001 From: Edward Caunt Date: Fri, 8 Aug 2025 15:56:52 +0000 Subject: [PATCH] compiler: Hotfix estimate memory again --- devito/operator/operator.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/devito/operator/operator.py b/devito/operator/operator.py index ce07ebb368..bacba1f872 100644 --- a/devito/operator/operator.py +++ b/devito/operator/operator.py @@ -1364,8 +1364,10 @@ def _get_nbytes(self, i): try: # Non-regular AbstractFunction (compressed, etc) nbytes = obj.nbytes_max - except AttributeError: - # Garden-variety AbstractFunction + except (AttributeError, ValueError): + # Either garden-variety AbstractFunction, or uninitialised + # function used in estimate. In the latter case, fall back + # to nbytes, as it is typically zero nbytes = obj.nbytes # Could nominally have symbolic nbytes at this point @@ -1461,7 +1463,8 @@ def nbytes_consumed_arrays(self): # Temporaries such as Arrays are allocated and deallocated on-the-fly # while in C land, so they need to be accounted for as well for i in self._op_symbols: - if not i.is_Array or not i._mem_heap or i.alias: + if not i.is_Array or not i._mem_heap or i.alias \ + or not i.is_regular: continue if i.is_regular: