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
Template TrilinosWrappers::Vector on memory space #16565
Template TrilinosWrappers::Vector on memory space #16565
Conversation
template <typename Number> | ||
template <typename Number, typename MemorySpace> | ||
class VectorReference |
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.
Perhaps default the argument here as well? It probably doesn't matter given that people will unlikely create objects of this type by hand, but it won't hurt.
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.
Looks good and makes sense! |
Thank you! I was planning on doing that on my own, but I hadn't found the time yet. |
I just checked it out and ran a few more tests, everything seems to work fine! |
Thank you, @masterleinad for making the change, and @kinnewig for confirming! |
For consistency with
TpetraWarappers::SparseMatrix
,TpetraWrappes::SparsityPattern
, andLinearAlgebra::distributed::Vector
, we should also templateTpetraWrappers::Vector
on the memory space being used.In particular, we need matching memory spaces for the sparse matrix-vector product anyway.
This also avoids allocating a second
View
when compiling with a GPU backend but only using host capabilities for these classes.