-
Notifications
You must be signed in to change notification settings - Fork 94
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
Remove templated matrix constructors #1433
Conversation
Kudos, SonarCloud Quality Gate passed!
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1433 +/- ##
===========================================
+ Coverage 91.04% 91.22% +0.17%
===========================================
Files 700 644 -56
Lines 56996 52904 -4092
===========================================
- Hits 51894 48260 -3634
+ Misses 5102 4644 -458 ☔ View full report in Codecov by Sentry. |
afd3e06
to
6e74674
Compare
6e74674
to
2d4c0c4
Compare
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.
first feedback. I would suggest to deprecate the initializer_list
constructors. Also, maybe we should try to merge constructors by using invalid values as default values.
@MarcelKoch Indeed the duplicate constructors are due to the fact that default parameters can't depend on other parameters. But the |
2d4c0c4
to
284a09f
Compare
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, only some minior comments.
As a note, I tried this branch with MFEM and can confirm that it doesn't seem to affect the integration. |
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!
284a09f
to
2763be8
Compare
- remove redundant constructors using default arguments Now most matrix classes only have two constructors: One with sizes for uninitialized data, and one with arrays for initialized data - add missing return value documentation - add missing documentation Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
2763be8
to
2784dd2
Compare
- Add comments for stride = 0 default value - Require square size for batch identity matrix Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
2784dd2
to
68e0022
Compare
|
This removes all templated array constructors and replaces them by versions that are based on array conversion constructors. This doesn't have any performance impacts except for the case when we pass in an lvalue (non-temporary/moved) that lives on another executor than the object we are constructing, where it leads to an additional allocation and copy on the source executor. That seems like an unimportant case to me, so I'm fine with the change making the interface simpler.
One thing this does have to change is the initialization from
initializer_list
. I'm honestly not sure whether this was explicitly designed to work, accidentally worked or something in between, I definitely had to dig why it works (the initializer list is being forwarded to thearray(exec, init_list)
constructor. If it was intended, we can't really change it, but it seems more like of a coincidental thing to me?EDIT: I dug some more, this was introduced in fcd8eff, where it seems intentionally intended for arrays only, and first used with
initializer_list
in #659, where it didn't come up in the discussion, so this kind of underlines the coincidental thing to me.