<div dir="ltr"><div dir="ltr">On Fri, Feb 10, 2023 at 11:31 AM Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 10, 2023 at 8:16 AM Ces VLC <<a href="mailto:cesarillovlc@gmail.com" target="_blank">cesarillovlc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<div><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">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.</div></blockquote><div>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 :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><br></div><div dir="auto">Has the situation changed since 2016, now that GPU support is being added to PETSc?</div><div dir="auto"><br></div><div dir="auto">An obvious solution would be if PETSc could be built prepending a prefix to all symbols (functions, structs, types, everything).</div></blockquote><div>Sounds like a bomb </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><br></div><div dir="auto">Any advances, plans, or thoughts on this?</div></blockquote><div>Interfacing petsc with libraries (e.g.,Gingko) that support mixed-precision could be an approach. But we have not tried that yet. <br></div></div></div></blockquote><div><br></div><div>The datatype on device need not match the datatype on the CPU. This is how I prefer to do things, running float on device and double on the CPU. This is possible now I think.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto"><br></div><div dir="auto">César</div><div dir="auto"><br></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>