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

compiler: prevent temporary for local reductions #2218

Merged
merged 2 commits into from
Sep 28, 2023
Merged

compiler: prevent temporary for local reductions #2218

merged 2 commits into from
Sep 28, 2023

Conversation

mloubout
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #2218 (47bf87c) into master (a7d9c49) will increase coverage by 0.00%.
The diff coverage is 91.48%.

@@           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     
Files Coverage Δ
devito/builtins/utils.py 75.90% <100.00%> (ø)
devito/ir/equations/equation.py 89.47% <ø> (ø)
devito/ir/support/properties.py 80.76% <100.00%> (+0.76%) ⬆️
devito/types/sparse.py 88.67% <100.00%> (-0.26%) ⬇️
tests/test_dse.py 99.80% <100.00%> (+<0.01%) ⬆️
devito/ir/clusters/algorithms.py 95.47% <93.75%> (+0.13%) ⬆️
devito/ir/clusters/cluster.py 93.91% <50.00%> (-0.44%) ⬇️
tests/test_dle.py 95.93% <88.23%> (-0.22%) ⬇️

... and 1 file with indirect coverage changes

@mloubout mloubout force-pushed the red-loc branch 5 times, most recently from 867f4d2 to 6eb40bd Compare September 27, 2023 20:11
devito/types/sparse.py Show resolved Hide resolved
devito/ir/equations/equation.py Show resolved Hide resolved
devito/ir/clusters/cluster.py Outdated Show resolved Hide resolved
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
Copy link
Contributor

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))

?

Copy link
Contributor Author

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

Copy link
Contributor

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(...)

Copy link
Contributor Author

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]inself.function`

Copy link
Contributor

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 Show resolved Hide resolved
"""
Extract the right-hand sides of reduction Eq's in to temporaries.
"""
if not cluster.is_sparse:
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be uselss

devito/ir/clusters/algorithms.py Outdated Show resolved Hide resolved
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
Copy link
Contributor

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(...)

devito/ir/support/properties.py Show resolved Hide resolved
devito/ir/support/properties.py Outdated Show resolved Hide resolved
devito/types/sparse.py Show resolved Hide resolved
@mloubout mloubout merged commit b610ccf into master Sep 28, 2023
32 checks passed
@mloubout mloubout deleted the red-loc branch September 28, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants