Skip to content

Commit e738e2a

Browse files
committed
Fix HPX scope guard
1 parent 7ac367d commit e738e2a

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

include/plssvm/environment.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ inline void finalize_backend([[maybe_unused]] const backend_type backend) {
228228
#if defined(PLSSVM_HAS_HPX_BACKEND)
229229
if (backend == backend_type::hpx) {
230230
::hpx::post([] { ::hpx::finalize(); });
231+
::hpx::stop();
231232
}
232233
#endif
233234
}

tests/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,10 @@ void ensure_finalization() {
5151
int main(int argc, char **argv) {
5252
::testing::InitGoogleTest(&argc, argv);
5353

54-
#if defined(PLSSVM_HAS_HPX_BACKEND)
55-
// initialize environments
56-
plssvm::environment::initialize();
57-
#else
5854
// initialize environments and manage lifetime with Scope Guard
5955
const plssvm::environment::scope_guard environment_guard{};
6056
// Note: necessary for Kokkos::SYCL
6157
[[maybe_unused]] const int ret = std::atexit(ensure_finalization);
62-
#endif
6358

6459
// prevent problems with fork() in the presence of multiple threads
6560
// https://github.com/google/googletest/blob/main/docs/advanced.md#death-tests-and-threads

0 commit comments

Comments
 (0)