-
Notifications
You must be signed in to change notification settings - Fork 256
compiler: misc sparse bug fixes #2912
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
Changes from all commits
17ee8f9
8e2ea64
1520fa2
a54b3c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,12 +13,13 @@ | |
| ) | ||
| from devito.symbolics import indexify, retrieve_function_carriers | ||
| from devito.tools import ( | ||
| ReducerMap, as_tuple, dtype_to_mpidtype, filter_ordered, flatten, is_integer, prod | ||
| ReducerMap, as_tuple, dtype_to_mpidtype, filter_ordered, flatten, is_integer, | ||
| memoized_meth, prod | ||
| ) | ||
| from devito.types.basic import Symbol | ||
| from devito.types.dense import DiscreteFunction, SubFunction | ||
| from devito.types.dimension import ( | ||
| ConditionalDimension, DefaultDimension, Dimension, DynamicDimension | ||
| ConditionalDimension, CustomDimension, DefaultDimension, Dimension, DynamicDimension | ||
| ) | ||
| from devito.types.dimension import dimensions as mkdims | ||
| from devito.types.equation import Eq, Inc | ||
|
|
@@ -386,6 +387,24 @@ def _position_map(self): | |
| def dist_origin(self): | ||
| return self._dist_origin | ||
|
|
||
| @memoized_meth | ||
| def _crdim(self, dim): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unclear what a "crdim" is, so I think a docstring is due
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "custom radius dimension" but sure can add docstring |
||
| """ | ||
| The CustomDimension associated with the Dimension `dim` for | ||
| the radius of the interpolation/injection stencil | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ultra-nitpick: full stop |
||
| """ | ||
| sname = self._sparse_dim.name | ||
| return CustomDimension(f"r{sname}{dim.name}", -self.r+1, | ||
| self.r, 2*self.r, self._sparse_dim) | ||
|
|
||
| @memoized_meth | ||
| def _cond_rdim(self, dim, cond): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also struggle with this name |
||
| """ | ||
| The interpolation/injection radius dimension with guard bounds | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ultra-nitpick: full stop
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe also "guarded"? |
||
| """ | ||
| parent = self._crdim(dim) | ||
| return ConditionalDimension(parent.name, parent, condition=cond, indirect=True) | ||
|
|
||
| def interpolate(self, *args, **kwargs): | ||
| """ | ||
| Implement an interpolation operation from the grid onto the given sparse points | ||
|
|
||
Large diffs are not rendered by default.
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.
bad sign -- is it symptomatic of a change of state?
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.
self.sfunction._crdimis memoized, caching on top doesn't have any benefit and would actually double cache itThere 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 in a different class and we shouldn't generally rely on that, so I'd keep the cached_property