Open pelesh opened 6 months ago
After looking at possible use cases, I think it is better if update
methods set flags only for memory spaces they updated. A user may run updates for for host and device in separate calls and bring them both to same up-to-date values. In this case "automatic" assumption that the other memory space is out of date would be untrue.
What I suggest is that
updateData
and updateValues
functions set "updated" flags only for the memory space they act on (update).setUpdated
and setNotUpdated
functions.A possible action here would be to allow setNotUpdated
function to set specific memory space as not current. Other functionality is already available in ReSolve.
@maksud, please chime in, as well.
In
update
methods in vector and matrix classes it is probably safer to set both update flags at the same time - i.e if cpu data gets updated, gpu data automatically should switch to NOT updated._Originally posted by @kswirydo in https://github.com/ORNL/ReSolve/pull/124#discussion_r1429345023_