forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Kokkos::finalize
JBludau edited this page Sep 1, 2022
·
1 revision
Header File: Kokkos_Core.hpp
Shut down all enabled Kokkos backends and free all associated resources. This function should be called after calling all other Kokkos API functions, including Kokkos object destructors.
Programs are ill-formed if they do not call this function after calling Kokkos::initialize.
Usage:
Kokkos::finalize(); Kokkos::finalize();- None
-
Kokkos::finalizemust be called beforeMPI_Finalizeif Kokkos is used in an MPI context. -
Kokkos::finalizemust be called after user initialized Kokkos objects are out of scope.
-
Kokkos::is_initialized()should return false after callingKokkos::finalize
int main(int argc, char** argv) {
Kokkos::initialize(argc, argv);
// add scoping to ensure my_view destructor is called before Kokkos::finalize
{
Kokkos::View<double*> my_view("my_view", 10);
}
Kokkos::finalize();
}