is_initialized
¶
Defined in header <Kokkos_Core.hpp>
Interface¶
-
bool is_initialized()¶
Queries the initialization status of Kokkos and returns
true
if Kokkos is initialized andfalse
if Kokkos is not initialized. This function can be called prior or after Kokkos initialization or finalization.- Returns:
true
ifinitialize()
has been called; false otherwise.
Examples¶
#include <Kokkos_Core.hpp>
#include <cassert>
int main(int argc, char* argv[]) {
assert(!Kokkos::is_initialized());
Kokkos::initialize(argc, argv);
assert(Kokkos::is_initialized());
Kokkos::finalize();
assert(Kokkos::is_finalized());
}