-
Notifications
You must be signed in to change notification settings - Fork 7
Enhance type stability with extra type parameter #103
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
Conversation
extra external constructor for convenience
function reuse with `_plan_fft`
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
==========================================
- Coverage 97.21% 96.22% -0.99%
==========================================
Files 4 4
Lines 431 424 -7
==========================================
- Hits 419 408 -11
- Misses 12 16 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| macro test_allocations(args) | ||
| if Base.VERSION >= v"1.9" | ||
| :(@allocations($(esc(args)))) | ||
| @static if Base.VERSION >= v"1.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own reference, what's the effect of this change? I know basic macros, and I'm guessing that the point is to ensure the @allocations symbol doesn't appear in code run for Julia <1.9, but I was under the impression that the revised code amounts to the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@static causes the if statement to be evaluated only once during macro expansion, so after that the macro would be the code in only one of the branches. I suspected weird "action-at-a-distance" machinery was involved in allocating so I wanted to minimise extraneous code paths.
That was also the motivation for escaping the @allocations macro.
How much this actually works, not clear, but it's not harmful or incorrect and the tests pass with this change.
dannys4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
For
FFTAPlan_reandFFTAPlan_cx, plus a bit of cleanup. Slightly editedtest_allocations, which is still a bit wonky because apparently when testingcheckbounds=truecauses allocations, althought that's technically a Julia problem. Maybe better to remove those tests altogether.For compat, an extra constructor that takes only the first two params.
sort!also feels somewhat questionable when e.g.2:-1:1can be passed as the region argument