Closed mcarlson801 closed 8 months ago
Also, I noticed that the typedef is still
using KV = ...
, which is a bit confusing since KV is not a vector but a DualView. Would you mind chaning that to something likeusing DV = ...
orusing DualView = ...
, which is a bit more self-documenting?
Good call, I'll go ahead and update that.
This PR fixes a bug that only shows up in debug builds and was introduced by the recent changes to replace Kokkos::vector. DualView's
resize
sets the modify flag on device and then a later call tomodify_host
causes the modify flag to be true on both host and device. With a debug build, this situation causes an exception to be thrown.This fix adds a sync after the resize to clear the modify flags. Looking at the implementation of DualView's
resize
, it looks like there might be situations where the host modify flag is set instead. Therefore, I've added syncs for host and device just in case. It's not an elegant solution but whichever one is unnecessary will be a no-op.