Skip to main content
`Ctrl`+`K`

# PetscKokkosInitializeCheck

Initialize Kokkos if it has not already been initialized

## Synopsis

    PetscErrorCode PetscKokkosInitializeCheck(void)

Not Collective

## Notes

Called internally before PETSc invokes any Kokkos-based functionality. The first call initializes Kokkos using either the user’s command-line options or defaults derived from PETSc’s device configuration; subsequent calls are no-ops.

PETSc will call `Kokkos::finalize()` itself during `PetscFinalize()` only if it was the one that initialized Kokkos in this process.

## See Also

`PetscInitialize()`, `PetscFinalize()`, `PetscDeviceContext`

## Level

developer

## Location

src/sys/objects/kokkos/kinit.kokkos.cxx

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages