is_finalized

Defined in header <Kokkos_Core.hpp>

Interface

bool is_finalized()

Queries the finalization status of Kokkos and returns true if Kokkos is finalized and false if Kokkos is not finalized. This function can be called prior or after Kokkos initialization or finalization.

Returns:

true if finalize() has been called; false otherwise.

Examples

#include <Kokkos_Core.hpp>
#include <cassert>

int main(int argc, char* argv[]) {
    assert(!Kokkos::is_finalized());
    Kokkos::initialize(argc, argv);
    assert(!Kokkos::is_finalized());
    Kokkos::finalize();
    assert(Kokkos::is_finalized());
}

See also

Kokkos::InitializationSettings

Define the settings for initializing Kokkos programmatically.

Kokkos::ScopeGuard

A class to initialize and finalize Kokkos using RAII.