-
Notifications
You must be signed in to change notification settings - Fork 170
[SPARSE] Turn matrix_view into an aggregate #608
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
[SPARSE] Turn matrix_view into an aggregate #608
Conversation
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.
Thanks Paolo, this is a nice solution. @gajanan-choudhary if you are fine with this approach we will also put ut a spec PR for this change.
|
||
matrix_view() = default; | ||
|
||
matrix_view(matrix_descr type_view) : type_view(type_view) {} |
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.
@Rbiessy, @pgorlani, I somehow missed this PR back when it was created. I reviewed the PR, but it seems to be going in the opposite direction of uxlfoundation/oneAPI-spec#578 by removing constructors rather than adding them. But at the same time, it also does seem to solve the issue uxlfoundation/oneAPI-spec#578. I'm not sure I understand what you mean by "turn matrix_view into an aggregate", could you explain how this works, or point me to a link I can read up on?
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.
Hey @gajanan-choudhary, if I remember correctly, removing explicit constructors allows for this type to be initialized in more ways, see https://en.cppreference.com/w/cpp/language/aggregate_initialization the section "Implicitly initialized elements".
I didn't push for this PR as we don't have the bandwidth to add new features on oneMath anymore. This would also need a spec update so I'd rather close this PR. Anyone picking up this task in the future can find the reference to this PR and take inspiration.
oneapi::mkl::sparse::matrix_view default_A_view{ | ||
oneapi::mkl::sparse::matrix_descr::triangular | ||
}; |
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'd suggest adding the defaults here at least as comments for clarity.
oneapi::mkl::sparse::matrix_view default_A_view{ | |
oneapi::mkl::sparse::matrix_descr::triangular | |
}; | |
oneapi::mkl::sparse::matrix_view default_A_view{ oneapi::mkl::sparse::matrix_descr::triangular /*, | |
oneapi::mkl::uplo::lower, | |
oneapi::mkl::diag::nonunit*/ }; | |
}; |
Closing as it would need more work and Paolo is not working on oneMath anymore. |
Description
This patch turns
sparse::matrix_view
into an aggregate having member initializers.Fixes uxlfoundation/oneAPI-spec#578
Checklist
All Submissions