Class TempLat::device_kokkos::DeviceGuard
ClassList > TempLat > device_kokkos > DeviceGuard
A class to manage and initialize the Kokkos runtime environment and its dependencies. More...
#include <kokkos_guard.h>
Public Functions
| Type | Name |
|---|---|
| DeviceGuard (int argc, char ** argv, bool verbose=false) |
|
| ~DeviceGuard () |
Public Static Functions
| Type | Name |
|---|---|
| int | GetInstanceCount () |
| int | getDeviceId () |
Detailed Description
The DeviceGuard class ensures proper initialization and finalization of the Kokkos runtime environment and associated libraries such as MPI. It is designed to be instantiated exactly once per process, typically at the beginning of the main function. The class handles thread safety, MPI threading level verification, and manages a local sub-communicator for node-local operations.
Proper use of this class prevents multiple unwanted instances of Kokkos initialization and ensures that all resources are cleaned up upon program termination.
Public Functions Documentation
function DeviceGuard
inline TempLat::device_kokkos::DeviceGuard::DeviceGuard (
int argc,
char ** argv,
bool verbose=false
)
function ~DeviceGuard
Public Static Functions Documentation
function GetInstanceCount
function getDeviceId
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/parallel/devices/kokkos/session/kokkos_guard.h