[petsc-users] MatVec on GPUs

Matthew Knepley knepley at gmail.com
Sun Oct 17 18:50:14 CDT 2021


On Sun, Oct 17, 2021 at 7:12 PM Swarnava Ghosh <swarnava89 at gmail.com> wrote:

> Do I need convert the MATSEQBAIJ to a cuda matrix in code?
>

You would need a call to MatSetFromOptions() to take that type from the
command line, and not have
the type hard-coded in your application. It is generally a bad idea to hard
code the implementation type.


> If I do it from command line, then are the other MatVec calls are ported
> onto CUDA? I have many MatVec calls in my code, but I specifically want to
> port just one call.
>

You can give that one matrix an options prefix to isolate it.

  Thanks,

     Matt


> Sincerely,
> Swarnava
>
> On Sun, Oct 17, 2021 at 7:07 PM Junchao Zhang <junchao.zhang at gmail.com>
> wrote:
>
>> You can do that with command line options -mat_type aijcusparse -vec_type
>> cuda
>>
>> On Sun, Oct 17, 2021, 5:32 PM Swarnava Ghosh <swarnava89 at gmail.com>
>> wrote:
>>
>>> Dear Petsc team,
>>>
>>> I had a query regarding using CUDA to accelerate a matrix vector
>>> product.
>>> I have a sequential sparse matrix (MATSEQBAIJ type). I want to port a
>>> MatVec call onto GPUs. Is there any code/example I can look at?
>>>
>>> Sincerely,
>>> SG
>>>
>>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211017/1a9f0d5f/attachment.html>


More information about the petsc-users mailing list