From: Daniel Arndt Date: Fri, 20 Jan 2023 21:26:07 +0000 (-0500) Subject: Fix race condition in implicit Kokkos initialization X-Git-Tag: v9.5.0-rc1~628^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b2cffcd84a9f56810bbe9d1c8592cbc4fef63a6;p=dealii.git Fix race condition in implicit Kokkos initialization --- 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);