-
Couldn't load subscription status.
- Fork 172
[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
pgorlani
wants to merge
1
commit into
uxlfoundation:develop
from
pgorlani:add-matrix-view-constructor
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -58,9 +58,12 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes | |||||||||||||||
| oneapi::mkl::index_base index_zero = oneapi::mkl::index_base::zero; | ||||||||||||||||
| oneapi::mkl::sparse::spsv_alg default_alg = oneapi::mkl::sparse::spsv_alg::default_alg; | ||||||||||||||||
| oneapi::mkl::sparse::spsv_alg no_optimize_alg = oneapi::mkl::sparse::spsv_alg::no_optimize_alg; | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view default_A_view(oneapi::mkl::sparse::matrix_descr::triangular); | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view upper_A_view(oneapi::mkl::sparse::matrix_descr::triangular); | ||||||||||||||||
| upper_A_view.uplo_view = oneapi::mkl::uplo::upper; | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view default_A_view{ | ||||||||||||||||
| oneapi::mkl::sparse::matrix_descr::triangular | ||||||||||||||||
| }; | ||||||||||||||||
|
Comment on lines
+61
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 upper_A_view{ oneapi::mkl::sparse::matrix_descr::triangular, | ||||||||||||||||
| oneapi::mkl::uplo::upper, | ||||||||||||||||
| oneapi::mkl::diag::nonunit }; | ||||||||||||||||
| bool no_reset_data = false; | ||||||||||||||||
| bool no_scalars_on_device = false; | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -99,20 +102,24 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes | |||||||||||||||
| no_reset_data, no_scalars_on_device), | ||||||||||||||||
| num_passed, num_skipped); | ||||||||||||||||
| // Test lower triangular unit diagonal matrix | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view triangular_unit_A_view( | ||||||||||||||||
| oneapi::mkl::sparse::matrix_descr::triangular); | ||||||||||||||||
| triangular_unit_A_view.diag_view = oneapi::mkl::diag::unit; | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view lower_unit_A_view{ | ||||||||||||||||
| oneapi::mkl::sparse::matrix_descr::triangular, oneapi::mkl::uplo::lower, | ||||||||||||||||
| oneapi::mkl::diag::unit | ||||||||||||||||
| }; | ||||||||||||||||
| EXPECT_TRUE_OR_FUTURE_SKIP( | ||||||||||||||||
| test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, | ||||||||||||||||
| transpose_val, alpha, default_alg, triangular_unit_A_view, | ||||||||||||||||
| default_properties, no_reset_data, no_scalars_on_device), | ||||||||||||||||
| transpose_val, alpha, default_alg, lower_unit_A_view, default_properties, | ||||||||||||||||
| no_reset_data, no_scalars_on_device), | ||||||||||||||||
| num_passed, num_skipped); | ||||||||||||||||
| // Test upper triangular unit diagonal matrix | ||||||||||||||||
| triangular_unit_A_view.uplo_view = oneapi::mkl::uplo::upper; | ||||||||||||||||
| oneapi::mkl::sparse::matrix_view upper_unit_A_view{ | ||||||||||||||||
| oneapi::mkl::sparse::matrix_descr::triangular, oneapi::mkl::uplo::upper, | ||||||||||||||||
| oneapi::mkl::diag::unit | ||||||||||||||||
| }; | ||||||||||||||||
| EXPECT_TRUE_OR_FUTURE_SKIP( | ||||||||||||||||
| test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, | ||||||||||||||||
| transpose_val, alpha, default_alg, triangular_unit_A_view, | ||||||||||||||||
| default_properties, no_reset_data, no_scalars_on_device), | ||||||||||||||||
| transpose_val, alpha, default_alg, upper_unit_A_view, default_properties, | ||||||||||||||||
| no_reset_data, no_scalars_on_device), | ||||||||||||||||
| num_passed, num_skipped); | ||||||||||||||||
| // Test non-default alpha | ||||||||||||||||
| EXPECT_TRUE_OR_FUTURE_SKIP( | ||||||||||||||||
|
|
||||||||||||||||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.