Skip to content

compiler: Add a node for standalone macro statements - #3097

Open
ada-wh525 wants to merge 3 commits into
devitocodes:mainfrom
ada-wh525:ada-wh525/standalone-macro-node
Open

ada-wh525 wants to merge 3 commits into
devitocodes:mainfrom
ada-wh525:ada-wh525/standalone-macro-node

Conversation

@ada-wh525

Copy link
Copy Markdown
Contributor

Introduce MacroStatement as a leaf IET statement and generate standalone macro invocations through CGen. Cover code generation, statement mapping, node discovery and transformations.

Fixes #2853.

Validation on macOS arm64 with Python 3.14.4, SymPy 1.14.0 and LLVM/Clang OpenMP:

  • tests/test_iet.py tests/test_visitors.py: 58 passed.
  • CPU suite with pytest -q -n 2 -m "not parallel and not decoupler" tests/: 3667 passed, 50 skipped, 4 xfailed in 857.63 seconds.
  • All applicable pre-commit hooks passed for the three changed files; Ruff preview checks also passed.
  • A C program generated using MacroStatement compiled with clang -Wall -Wextra -Werror and ran successfully.

GPU execution, MPI/decoupler tests and the full CI platform matrix were not run locally.

Introduce MacroStatement as a leaf IET statement and generate standalone macro invocations through CGen. Cover code generation, statement mapping, node discovery and transformations.

Fixes devitocodes#2853.

@mloubout mloubout left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution.

However this doesn't really implement the node, there is plenty of macro through the compiler and if a node for Macro is added they should all be switched to it.

Currently this is an unused change that is only tested standalone, not as part of the compiler.

@ada-wh525

Copy link
Copy Markdown
Contributor Author

Updated in a1c1bb5. MacroStatement is now used for kernel-launch checks, CPU denormal controls, and profiling timers.

Added compiler-path tests, including compiling and running C/OpenMP Operators. Merged the latest main and resolved the test conflicts.

Validation:

  • Focused tests: 77 passed.
  • CPU suite: 3817 passed, 26 skipped, 4 xfailed, 2 failed. Both failures also reproduce on unmodified upstream main in the same environment (x86 headers on ARM and a gradient tolerance assertion).
  • All applicable pre-commit checks passed.

Could you take another look? Thanks!

Thank you for the contribution.

However this doesn't really implement the node, there is plenty of macro through the compiler and if a node for Macro is added they should all be switched to it.

Currently this is an unused change that is only tested standalone, not as part of the compiler.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce Node class for standalone macros

2 participants