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

make inner loop pattern tags constexpr. resolves #319 #321

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

Yurlungur
Copy link
Collaborator

@Yurlungur Yurlungur commented Oct 12, 2020

PR Summary

As discussed in issue #319, the inner loop pattern tag dispatch can fail on lower optimization levels, because the tags do not have device scope. One way to fix this is to add __device__ to each tag, but this is not performance portable. Another way is to make the tags constexpr so that they can pull device from local scope when they are used. This implements the latter solution.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md

@Yurlungur Yurlungur added the bug Something isn't working label Oct 12, 2020
@Yurlungur Yurlungur self-assigned this Oct 12, 2020
@Yurlungur Yurlungur linked an issue Oct 12, 2020 that may be closed by this pull request
Copy link
Collaborator

@forrestglines forrestglines left a comment

Choose a reason for hiding this comment

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

Looks good, compiles on my end.

Copy link
Collaborator

@JoshuaSBrown JoshuaSBrown left a comment

Choose a reason for hiding this comment

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

Nice fix!

@Yurlungur
Copy link
Collaborator Author

Cool. Pulling the trigger. Thanks.

@Yurlungur Yurlungur merged commit 61cf3a0 into develop Oct 13, 2020
@Yurlungur Yurlungur deleted the jmm/constexpr-tags branch December 7, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inner loop pattern tags not portable
4 participants