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
Make a deep-copy of the Tpetra::Vector in the assignment operator. #16558
Conversation
6cd25b0
to
f22c82d
Compare
/rebuild |
d9a9b6f
to
810153e
Compare
Nice, that was a good suggestion @masterleinad! |
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0) | ||
auto source_vector_2d = | ||
V.vector->template getLocalView<Kokkos::HostSpace>( | ||
Tpetra::Access::ReadOnly); | ||
# else | ||
auto source_vector_2d = | ||
V.vector->template getLocalView<Kokkos::HostSpace>(); | ||
# endif |
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.
Since we are now using deep_copy
, is there a good reason to extract the host view instead of the device view? In case of a device memory space (which we don't support yet), the approach here seems to make unnecessary copies between host and device since all operations are explicitly done on the host.
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.
Let's just get this in and we can look at this somewhere else.
Follow up of the PR #16545.
In the assignment operator, we must perform a deep-copy of the vector instead of a shallow copy.
This should fix the assignment operator.