Add some utility routines to LayoutCS #25244
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds some new utility routines to the CS[R|C] sparse layout implemented in LayoutCS. The new routines are:
Note that these routines are currently being added specifically to the CSR/C layout because they are both very 2D-specific and our more general, default sparse array layout can support 1D, 3D, nD domains and arrays as well, so it's not clear how to generalize them to those cases.
I've also added a test that checks that these new routines work on CSR|C domains and arrays.
These have not received any significant discussion or design review, but have been very handy in prototyping sparse matrix-matrix multiplication routines in Chapel and are features that users of 2D sparse arrays have been requesting for some time. My thought is that it would be better to have the features in an non-design-reviewed form for now to continue exploring sparse computations and learning from those explorations, leaning on the instabiliy of sparse features for now.