Yes, this is supported. You can use VecGetArrayAndMemType() to get access to device memory. You'll often use DMGlobalToLocalBegin/End() or VecScatter to communicate, but that will use GPU-aware MPI if your Vec is a device vector.
Han Tran <hant...@cs.utah.edu> writes: > Hi, > > I am aware that PETSc recently supports solvers on GPU. I wonder whether > PETSc supports MatShell with GPU solvers, i.e., I have a user-defined > MatMult() function residing on the device, and I want to use MatShell > directly with PETSc GPU solvers without any transfer back and forth between > host and device. If this is possible, could you let me know how to do this > (an example, if any, would be very appreciated)? > > Thank you! > Han