From 9b2cffcd84a9f56810bbe9d1c8592cbc4fef63a6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 20 Jan 2023 16:26:07 -0500 Subject: [PATCH] Fix race condition in implicit Kokkos initialization --- include/deal.II/lac/vector_memory.templates.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/deal.II/lac/vector_memory.templates.h b/include/deal.II/lac/vector_memory.templates.h index ee4fadadd6..49e06d7dcc 100644 --- a/include/deal.II/lac/vector_memory.templates.h +++ b/include/deal.II/lac/vector_memory.templates.h @@ -41,8 +41,8 @@ GrowingVectorMemory::get_pool() // finalized past program end together with static variables and we need to // make sure to empty the Pool when finalizing Kokkos so that the destruction // of the Pool doesn't call Kokkos functions. - internal::ensure_kokkos_initialized(); static auto pool = []() { + internal::ensure_kokkos_initialized(); if (!internal::dealii_initialized_kokkos) Kokkos::push_finalize_hook( GrowingVectorMemory::release_unused_memory); -- 2.39.5