Thank you, Andreas. The documentation does mention that PETSc internally
keeps track of which (host or device) vector is last updated. So when I
update the memory on the PyCUDA side, maybe PETSc doesn't know about it.
Thank you, I'll investigate further.
On Thu, Oct 16, 2014 at 1:28 PM, Andreas Kloeckner <lists(a)informa.tiker.net>
Ashwin Srinath <ashwinsrnth(a)gmail.com> writes:
> I'm not sure - but this may have something to do with the implementation
> `fill`. Because on the flip side, changes to the PETSc Vec *are*
> the GPUArray. So I can see that they are actually sharing device memory..
As far as I know, PETSc maintains a copy of the vector on the host and
on the device and tacitly assumes that nobody except it makes
modifications to the vector. So if it assumes nobody has modified the
device-side vector, it may give you a (stale) host-side copy.