-
Notifications
You must be signed in to change notification settings - Fork 248
compiler: Enhance IR to support more advanced parlang (CUDA/HIP/SYCL) features #2840
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2840 +/- ##
==========================================
- Coverage 78.97% 78.95% -0.02%
==========================================
Files 248 248
Lines 50936 51043 +107
Branches 4404 4414 +10
==========================================
+ Hits 40226 40303 +77
- Misses 9909 9934 +25
- Partials 801 806 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mloubout
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.
Mintoi comments but was already reviewed in the previous one so looks good
devito/ir/clusters/cluster.py
Outdated
| return {i for i in self.free_symbols if i.is_Dimension} | idims | ||
| dims_exprs = {i for i in self.free_symbols if i.is_Dimension} | ||
|
|
||
| dims_implicit = set().union(*[set(e.implicit_dims) for e in self.exprs]) |
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.
don't need set(e.implicit_dims) just e.implicit_dims
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.
Could even just be dims_implicit = {d for e in self.exprs for d in e.implicit_dims}
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.
ok fixing, Ed has a point
| sub_iterators = dict([(k, tuple(filter_ordered(as_tuple(v)))) | ||
| for k, v in (sub_iterators or {}).items()]) | ||
| sub_iterators = sub_iterators or {} | ||
| sub_iterators = {d: tuple(filter_ordered(as_tuple(v))) |
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.
That's quite a lot of tuple conversion but doubt can be changed
devito/ir/clusters/cluster.py
Outdated
| return {i for i in self.free_symbols if i.is_Dimension} | idims | ||
| dims_exprs = {i for i in self.free_symbols if i.is_Dimension} | ||
|
|
||
| dims_implicit = set().union(*[set(e.implicit_dims) for e in self.exprs]) |
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.
Could even just be dims_implicit = {d for e in self.exprs for d in e.implicit_dims}
devito/ir/clusters/cluster.py
Outdated
|
|
||
| dims_implicit = set().union(*[set(e.implicit_dims) for e in self.exprs]) | ||
|
|
||
| syms_guards = set().union(*[e.free_symbols for e in self.guards.values()]) |
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.
You can do the same with this one, which will improve readability and homogeneity
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.
ok
devito/symbolics/extended_sympy.py
Outdated
| class Terminal: | ||
|
|
||
| """ | ||
| Abstract base class for all terminal objects, that is, those objects |
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 docstring seems a little tautologous - a terminal is an object collected by retrieve_terminals which is a function that retrieves objects that are terminals. Might be worth noting what makes an object "terminal"? I'm guessing anything which is always a leaf node with no children?
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.
tweaking it
btw:
a leaf node with no children
by definition a leaf node has no children
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.
You know what I was saying about tautology...
devito/symbolics/extended_sympy.py
Outdated
|
|
||
| Reserved objects have the following properties: | ||
|
|
||
| * `estimate_cost(o) = 0`, where `o` is an instance of Reserved |
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.
Is this enforced by a subclass or superclass?
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.
I will delete that bit as it's irrelevant and perhaps confusing
206c29c to
1213648
Compare
1213648 to
0bc0755
Compare
0bc0755 to
03f1196
Compare
No description provided.