[petsc-users] GPUs and the float-double dilemma

Junchao Zhang junchao.zhang at gmail.com
Fri Feb 10 10:31:29 CST 2023


On Fri, Feb 10, 2023 at 8:16 AM Ces VLC <cesarillovlc at gmail.com> wrote:

> Hi!
>
> I searched if it’s supported to link an application to two different
> builds of PETSc (one configured as float precision, and the other as
> double). The last post I found on that topic was from 2016 and it said it’s
> not recommended.
>
> The point is that if you wish to prepare builds of your application for
> end-users, and if your app offers the option of using GPUs, you have a
> critical problem if you cannot link with two different PETSc builds in the
> same executable: either you don’t provide support for most GPUs (as they
> are float only), or you force float precision even when using the CPU. A
> third option (shipping two executables for the app) is not practical, as
> the user won’t be able to compare results without quitting the app and
> running the other version.
>
Why do you say most GPUs are float only?  I do not have a survey but the
NVIDIA, AMD, Intel GPUs I have access to all support double :)


>
> Has the situation changed since 2016, now that GPU support is being added
> to PETSc?
>
> An obvious solution would be if PETSc could be built prepending a prefix
> to all symbols (functions, structs, types, everything).
>
Sounds like a bomb

>
> Any advances, plans, or thoughts on this?
>
Interfacing petsc with libraries (e.g.,Gingko) that support mixed-precision
could be an approach. But we have not tried that yet.

>
> Thanks!
>
> César
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230210/14edfa0a/attachment.html>


More information about the petsc-users mailing list