-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature/eckit sparsematrix allocators reorganization, new in-place allocator #148
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #148 +/- ##
========================================
Coverage 63.74% 63.75%
========================================
Files 1066 1069 +3
Lines 55360 55397 +37
Branches 4086 4086
========================================
+ Hits 35289 35317 +28
- Misses 20071 20080 +9 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
99026bf
to
e59c541
Compare
Private downstream CI failed. |
Say a few more days before merge? I have changes depending on this. |
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 think this is great! A few points.
minor point: I would change to something like "NonOwningAllocator" or "WrappingAllocator"
more significant point:
When the SparseMatrix is created this way, wrapping existing data, the user of this class should not be allowed to call several methods:
SparseMatrix::reserve(rows, cols, nnz)
SparseMatrix::load()
SparseMatrix::transpose()
SparseMatrix::setIdentity()
SparseMatrix::prune()
In fact anything that is attempting to change the shape should be forbidden.
One option is to add a boolean flag to SparseMatrix::Shape
be set by the Allocator which can be checked if changes to shape are allowed or not. Open to other suggestions.
shape.cols_ = Nc_; | ||
|
||
SparseMatrix::Layout layout; | ||
layout.outer_ = reinterpret_cast<decltype(SparseMatrix::Layout::outer_)>(ia_); |
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 believe a reinterpret_cast or const_cast or any other casting should not be necessary.
This add a new "allocator" to the SparseMatrix, which allows building one with direct, non-owned access to a set of Index*, Index* and Scalar*.
It allows low-level control of the data structures, benefiting the following:
There's no urgency