Tpetra::MultiVector's method get1dViewNonConst does not mark HostView as modified.
Created by: bartgol
@trilinos/Tpetra
Expectations
MultiVector's method get1dViewNonConst
should mark the host space view as modified.
Current Behavior
Currently, it only returns a view to the host view.
Motivation and Context
Two reasons to have this done: the first, is that get2dViewNonConst
does mark the host view as modified, so as it is, the code seems not consistent; the second is precisely the comment in get2dViewNonConst
:
// When users call the NonConst variants, it implies that they // want to change the data. Thus, it is appropriate to mark this // MultiVector as modified.
Note: my need comes from the way Thyra adapters for Tpetra work. In particular, the method getLocal(Multi)VectorDataImpl
of Thyra::Tpetra(Multi)Vector
uses the method get1dViewNonConst
from Tpetra::MultiVector
in order to retrieve the local (Multi)Vector data on host. If I want to use that to modify the data, I would like that modification to be reflected on device, which cannot happen unless the host view is marked as modified.
Possible Solution
Add this->modify<Kokkos::HostSpace> ();
before returning.
Your Environment
- **Relevant repo SHA1s: 4f031984