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

Use the fact that helmholtz k is real for better codegen #176

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

isuruf
Copy link
Collaborator

@isuruf isuruf commented May 30, 2023

No description provided.

@isuruf isuruf marked this pull request as ready for review May 30, 2023 23:26
sumpy/kernel.py Outdated Show resolved Hide resolved
Co-authored-by: Alex Fikl <[email protected]>
@inducer inducer enabled auto-merge (squash) May 31, 2023 14:57
@inducer
Copy link
Owner

inducer commented May 31, 2023

Thanks!

@inducer inducer disabled auto-merge May 31, 2023 14:57
@inducer
Copy link
Owner

inducer commented May 31, 2023

Hmm, whoops. The changes made sense to me, but I missed that the CIs are failing.

@isuruf isuruf marked this pull request as draft May 31, 2023 17:21
sumpy/kernel.py Outdated
if allow_evanescent:
expr = var("exp")(var("I")*k*r)/r
else:
expr = var("exp")(var("Ik")*r)/r
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This hack is to allow the rewrite later on. Otherwise CSE will move this to another assignment.

Copy link
Owner

Choose a reason for hiding this comment

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

Add a comment to explain?

sumpy/codegen.py Outdated
@@ -592,6 +592,39 @@ def map_sum(self, expr, *args):
# }}}


# {{{ helmholtz rewrite
class HelmholtzRewriter(CSECachingIdentityMapper, CallExternalRecMapper):
Copy link
Owner

Choose a reason for hiding this comment

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

Add a docstring to explain intent.

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.

3 participants