-
Notifications
You must be signed in to change notification settings - Fork 230
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
compiler: prevent temporary for local reductions #2218
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2218 +/- ##
=======================================
Coverage 87.09% 87.09%
=======================================
Files 228 228
Lines 40723 40756 +33
Branches 7456 7463 +7
=======================================
+ Hits 35468 35498 +30
- Misses 4652 4654 +2
- Partials 603 604 +1
|
867f4d2
to
6eb40bd
Compare
function itself without indirection and therefore only contains dense operations. | ||
""" | ||
return (any(f.is_SparseFunction for f in self.functions) and | ||
len([f for f in self.functions |
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.
what if an Array?
perhaps a bit safer:
return all(split(self.functions, lambda f: f.is_SparseFunction))
?
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.
Not sure that's enough, that doesn't check if there actually is a sparse function I'll see if can simplify
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.
yes it should do it through the all(...)
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.
Yes but the other part may be wrong because there i a bunch of Dimension, ...
left in the other part of split so you might get a "false Truewith something like
[time, rec[time, p_rec], p_rec]in
self.function`
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.
ah OK
devito/ir/clusters/algorithms.py
Outdated
""" | ||
Extract the right-hand sides of reduction Eq's in to temporaries. | ||
""" | ||
if not cluster.is_sparse: |
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.
this should be uselss
function itself without indirection and therefore only contains dense operations. | ||
""" | ||
return (any(f.is_SparseFunction for f in self.functions) and | ||
len([f for f in self.functions |
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.
yes it should do it through the all(...)
No description provided.