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 <[email protected]> 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
