[petsc-users] GPUs and the float-double dilemma
Barry Smith
bsmith at petsc.dev
Fri Feb 10 14:44:04 CST 2023
What is the use case you are looking for that cannot be achieved by just distributing a single precision application? If the user is happy when they happen to have GPUs to use single precision everywhere, then why would they need double precision if they happen not to have a GPU?
Are you just using KSP or also SNES, TS etc?
> On Feb 10, 2023, at 7:59 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.
>
> 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).
>
> Any advances, plans, or thoughts on this?
>
> Thanks!
>
> César
>
More information about the petsc-users
mailing list