Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor[cartesian]: Minor cleanup in backends #1833

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

romanc
Copy link
Contributor

@romanc romanc commented Jan 29, 2025

Description

I was reading a lot of code around DaCe/gt-codegen when debugging the new DaCe/gt4py bridge. This PR combines three cleanup commits:

  • Always get stencil_ir from builder in GTBaseBackends. I've found no usage of stencil_ir being anything else than self.build.gtir if it was explicitly passed as an argument at all. There's thus no need to pass around self.build.gtir as long as we stay in the same class hierarchy.
  • Avoid unnecessary indenting in generated code. Generated code is optionally formatted, but even if not, we can make sure the code doesn't look too ugly.
  • Avoid double formatting of source code (if gt4py/dace is configured to do so). No need for formatting intermediate code parts because it's formatted anyway at the end.

Requirements

  • All fixes and/or new features come with corresponding tests.
    Updated test accordingly.
  • Important design decisions have been documented in the appropriate ADR inside the docs/development/ADRs/ folder.
    N/A

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
torives Victor Yves Crispim
All GT-based backends were explicitly providing the same argument, which
also was the fallback in case the sdfg_ir wasn't explicitly provided.
Removed that argument.
Formatting will be done (if configured) later once the full code complete.
No need for formatting of intermediate steps.
@romanc romanc force-pushed the romanc/backend-cleanup branch from f5ff942 to 6dfa56e Compare January 30, 2025 13:28
@romanc romanc changed the title refactor[cartesian]: Always get stencil_ir from builder in GTBaseBackends refactor[cartesian]: Minor cleanup in backends Jan 30, 2025
@romanc romanc marked this pull request as ready for review January 30, 2025 13:40
Copy link
Contributor

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

One doubt about a removed assert but I would hope we catch no gtir much earlier that this code

@FlorianDeconinck FlorianDeconinck merged commit 050d3b3 into GridTools:main Jan 30, 2025
25 checks passed
@romanc romanc deleted the romanc/backend-cleanup branch January 30, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants