[petsc-users] PetscDeviceInitialize for Fortran 90

Jacob Faibussowitsch jacob.fai at gmail.com
Wed Jul 27 12:37:22 CDT 2022


There are no Fortran stubs for these functions (yet). 

Note that it is not necessary to call it yourself, it will be called implicitly for you whenever any device-side work is performed for the first time.

If you insist on having it called however, the easiest workaround to do so is to create a CUDA vector (of size >= 1) and call VecScale() on it.

Best regards,

Jacob Faibussowitsch
(Jacob Fai - booss - oh - vitch)

> On Jul 27, 2022, at 13:00, Han Tran <tranduchan at gmail.com> wrote:
> 
> 
> Hello,
> 
> As shown in https://petsc.org/release/docs/changes/317/?highlight=petsccudainitialize, PetscCUDAInitialize(MPI_Comm comm, PetscInt device) is replaced by PetscDeviceInitialize(PetscDeviceType type) in petsc-3.17. My Fortran-90 code gives a compile error as there is no header file “petscdevicetypes.h” in include/petsc/finclude. How can I use PetscDeviceInitialize() in Fortran 90?
> 
> Thank you,
> -Han
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220727/d6ed212d/attachment.html>


More information about the petsc-users mailing list