Skip to content

[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

Closed

Conversation

pgorlani
Copy link
Contributor

Description

This patch turns sparse::matrix_view into an aggregate having member initializers.

Fixes uxlfoundation/oneAPI-spec#578

Checklist

All Submissions

@pgorlani pgorlani requested a review from a team as a code owner October 30, 2024 16:16
Copy link
Contributor

@Rbiessy Rbiessy left a 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.

Comment on lines -41 to -44

matrix_view() = default;

matrix_view(matrix_descr type_view) : type_view(type_view) {}
Copy link
Contributor

@gajanan-choudhary gajanan-choudhary Mar 31, 2025

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?

Copy link
Contributor

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.

Comment on lines +61 to +63
oneapi::mkl::sparse::matrix_view default_A_view{
oneapi::mkl::sparse::matrix_descr::triangular
};
Copy link
Contributor

@gajanan-choudhary gajanan-choudhary Mar 31, 2025

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.

Suggested change
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*/ };
};

@Rbiessy
Copy link
Contributor

Rbiessy commented May 16, 2025

Closing as it would need more work and Paolo is not working on oneMath anymore.

@Rbiessy Rbiessy closed this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[oneMKL][Sparse BLAS] Missing constructor for oneapi::mkl::sparse::matrix_view
3 participants