is_initialized¶
Defined in header <Kokkos_Core.hpp>
Interface¶
-
bool is_initialized() noexcept¶
Queries the initialization status of Kokkos and returns
trueif Kokkos is initialized andfalseif Kokkos is not initialized. This function can be called prior or after Kokkos initialization or finalization.- Returns:
trueifinitialize()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_initialized());
}