<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Hector,<div class=""><br class=""></div><div class=""> You asked at just the right time. Mark Adams has started to implement some code to do this <a href="https://gitlab.com/petsc/petsc/-/merge_requests/3137" class="">https://gitlab.com/petsc/petsc/-/merge_requests/3137</a> it is now in the PETSc master branch. It is preliminary and not yet well documented but hopefully if you read through the MR (above) it will give you the main ideas. </div><div class=""><br class=""></div><div class=""> Please feel free to ask questions on this topic at GitLab or on <a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a> we are eager to have users for this material and improve it to make it practical and straightforward.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 30, 2020, at 9:49 AM, Héctor Barreiro Cabrera <<a href="mailto:hecbarcab@gmail.com" class="">hecbarcab@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Greetings fellow PETSc users!<br class=""><br class="">I have recently started working on a project that requires assembling and solving a large sparse linear system directly on the GPU using CUDA. I have just discovered that PETSc has support for building and solving such a system through cuSparse (MatSeqAICUSPARSE), which is quite cool because this opens up the possibility of using PETSc's awesome functionalities.<br class=""><br class="">However, I have not been able to find information about how (or even if it is possible) to assemble the matrix from data stored in device memory. From the documentation, it seems that vectors (VecSeqCUDA) expose the raw device pointer through VecCUDAGetArrayRead and VecCUDAGetArrayWrite functions which I could use to update the systems' RHS vector, but I couldn't find anything alike for matrices. Is there anything equivalent?<br class=""><br class="">Ideally I would like to generate all the assembly information from a kernel, avoiding any data synchronization with the host (except maybe updating the pointers). Is this even possible?<br class=""><br class="">Thank you very much for your help!<br class=""><br class="">Greetings,<br class="">Hector Barreiro</div>
</div></blockquote></div><br class=""></div></body></html>