[petsc-users] PETSc GPU matrix creation

Barry Smith bsmith at petsc.dev
Tue Jan 13 15:53:04 CST 2026


  Alberto,

    We don't have such a routine yet, but we should and it would not be terribly difficult to implement (using pieces of PETSc that already exist and cut and pasting them into a new function MatCreateSeqAICUSPARSEWithArrays()).

   Barry


> On Jan 13, 2026, at 1:44 PM, Alberto Cattaneo via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Greetings
> I hope this email reaches you all well. I was wondering whether it was possible to create PETSc mat objects directly from data that exists on the GPU in AIJ format without copying? For example, either via DLPack or just an assurance that the pointer provided to a creation method is in the needed AIJ format? Ideally, I'd like to be able to build a PETSc AIJCUSPARSE object out of data created by another program. I know there are a few builder methods and paradigms, but I'm a bit confused as to which would be ideal in this circumstance since in some sense the matrix is already created in memory, just not as a PETSc object.
> Thank you for your assistance, please let me know if I should provide more information.
> Respectfully:
> Alberto Cattaneo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20260113/bfcbba26/attachment.html>


More information about the petsc-users mailing list