-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix symmetric_matrix_rank_k_update, hermitian_matrix_rank_k_update, and symmetric_matrix_rank_1_update #263
Conversation
Header and namespace seem to have changed since last time.
Constrain symmetric_matrix_rank_k_update ExecutionPolicy overloads so that the compiler can distinguish them from alpha overloads.
Algorithm was giving incorrect results. This commit fixes that and improves the associated regression test.
Add a regression test that didn't build before this change, and now builds correctly.
1. Fix ambiguous overload for the no-scalar case 2. Fix the algorithm (so it gives the right answer, for both the scalar and no-scalar cases)
1. Fix ambiguous overload for the no-scalar case 2. Fix the algorithm (so it gives the right answer for the no-scalar case; the with-scalar case was already fixed in a previous commit)
Add a new trait for testing whether an ExecutionPolicy is a valid execution policy (either std::is_execution_policy_v or custom). Use it in symmetric_matrix_rank_k_update and hermitian_matrix_rank_k_update.
The reference implementation needs to implement all constraints of symmetric_matrix_rank_1_update in order to disambiguate overloads. Add a regression test as well.
@@ -4,8 +4,9 @@ | |||
// This must be defined before including any mdspan headers. | |||
#define MDSPAN_USE_PAREN_OPERATOR 1 | |||
|
|||
#include <experimental/mdspan> | |||
#include "experimental/__p2630_bits/submdspan.hpp" |
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.
Why explicitly include __p2630_bits/submdspan.hpp
?
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.
@dalg24 It didn't build (with GCC 11.4 + CMake 3.22.1, otherwise default settings) otherwise. I really just did this:
cmake ../../../src/kokkos/stdBLAS -DLINALG_ENABLE_TESTS=ON -DLINALG_ENABLE_EXAMPLES=ON
make -j12
and got errors about not finding submdspan
. Note that there's no <experimental/submdspan>
header to include.
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 the issue might be that we were meant to include <mdspan/mdspan.hpp>
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.
None of the following headers exist.
experimental/submdspan
experimental/submdspan.hpp
mdspan/submdspan
mdspan/submdspan.hpp
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.
Shouldn't <mdspan/mdspan.hpp>
include the submdspan headers?
@@ -17,7 +18,8 @@ | |||
using std::experimental::extents; | |||
using std::full_extent; // not in experimental namespace | |||
using std::experimental::mdspan; | |||
using std::experimental::submdspan; | |||
|
|||
using MDSPAN_IMPL_STANDARD_NAMESPACE :: submdspan; |
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.
Formatted weirdly. Also why is it not available from the same namespace as mdspan
?
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.
Please see above comment (it really didn't build otherwise).
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.
Header includes issues can be straighten out later
What this pull request fixes:
Add a trait that identifies an ExecutionPolicy as a valid (possibly custom) execution policy. (Note that it's forbidden for users to specialize
std::is_execution_policy_v
.)Fix build errors when calling the following functions with or without an
alpha
(but no execution policy), by constrainingExecutionPolicy
overloads (see Ambigious Template Definitions For "symmetric_matrix_rank_k_update" #261)symmetric_matrix_rank_k_update
hermitian_matrix_rank_k_update
symmetric_matrix_rank_1_update
Fix actual bugs in both the with-alpha and no-alpha
symmetric_matrix_rank_k_update
andhermitian_matrix_rank_k_update
overloads that were giving the wrong answersDrive-by fix for
submdspan
-related build errors in tests and examples, probably due to reference mdspan namespace changes that haven't been tested in this repository recentlyWhat this pull request does not fix or do:
ExecutionPolicy
overloads of all the algorithmsFixes #261.