From 55e037166369583b381871ecf6b65eb62fdc1b4d Mon Sep 17 00:00:00 2001 From: Fabio Luporini Date: Wed, 23 Aug 2023 15:35:30 +0000 Subject: [PATCH] WIP --- devito/passes/clusters/aliases.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/devito/passes/clusters/aliases.py b/devito/passes/clusters/aliases.py index 0e07b10d75b..e18d16f9588 100644 --- a/devito/passes/clusters/aliases.py +++ b/devito/passes/clusters/aliases.py @@ -366,17 +366,11 @@ def cbk_search(expr): def cbk_search2(expr, rank): ret = [] for e in cbk_search(expr): - v = e - mapper = deindexify(v) + mapper = deindexify(e) for i in rank: if i in mapper: ret.extend(mapper[i]) - - # Prevent nested substitutions - subs = {j: Symbol(name='aaa') for j in mapper[i]} - v = uxreplace(v, subs) - mapper = deindexify(v) - + break return ret candidates = sorted(grank, reverse=True)[:2] @@ -599,8 +593,6 @@ def collect(extracted, ispace, minstorage): nr = nredundants(ispace, pivot) score = estimate_cost(pivot, True)*((na - 1) + nr) if score > 0: - if score == 210: - from IPython import embed; embed() aliases.add(pivot, aliaseds, list(mapper), distances, score) return aliases @@ -1114,9 +1106,9 @@ def naliases(self): udims = set().union(*[unbounded(c.expr) for c in self._items]) sdims = [d for d in udims if d.is_Stencil] - implicit = int(np.prod([i._size for i in sdims])) - 1 + implicit = int(np.prod([i._size for i in sdims])) - return na + implicit + return na*max(implicit, 1) @cached_property def _pivot_legal_rotations(self):