From 2ed05aae35f022b0db2179578b346e4c77c8181c Mon Sep 17 00:00:00 2001 From: George Bisbas Date: Wed, 31 Jul 2024 17:48:29 +0300 Subject: [PATCH] compiler: Restore macros ordering after rebase --- devito/passes/iet/misc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devito/passes/iet/misc.py b/devito/passes/iet/misc.py index 740fb52f23..e9d8308336 100644 --- a/devito/passes/iet/misc.py +++ b/devito/passes/iet/misc.py @@ -151,8 +151,10 @@ def _generate_macros(iet, tracker=None, **kwargs): headers = sorted((ccode(define), ccode(expr)) for define, expr in headers) # Generate Macros from higher-level SymPy objects - applications = FindApplications().visit(iet) - headers = set().union(*[_generate_macros(i) for i in applications]) + headers.extend(_generate_macros_math(iet)) + + # Remove redundancies while preserving the order + headers = filter_ordered(headers) # Some special Symbols may represent Macros defined in standard libraries, # so we need to include the respective includes