For example,  src/ksp/ksp/tutorials/ex1.c,  which can be tested with these
options.  "-mat_type aijcusparse -vec_type cuda" enables GPU offloading.
test:
suffix: 2_aijcusparse
requires: cuda
args: -pc_type sor -pc_sor_symmetric -ksp_monitor_short
-ksp_gmres_cgs_refinement_type refine_always -mat_type aijcusparse
-vec_type cuda
args: -ksp_view

--Junchao Zhang


On Wed, Aug 23, 2023 at 9:27 AM TROTIGNON Laurent <[email protected]>
wrote:

> Hello all,
>
> In the on line docs of PETSc, I found this paragraph :
>
>
>
> « PETSc uses a single source programming model where solver back-ends are
> selected as *runtime* options and configuration options with no changes
> to the API.
>
> Users should (ideally) never have to change their source code to take
> advantage of new backend implementations. »
>
>
>
> I am looking for an example of runtime options that enable activation of
> GPU offloading of PETSc solvers.
>
> I am not sure that runtime options for GPU offloading are currently
> available ?
>
> I am currently using petsc/3.19.2 configured with cuda and nvhpc/22.2.
>
> Best regards
>
> Laurent
>
>
>

Reply via email to