Currently, in the tests, Kokkos is initialised and finalised in each test body.
In
@dalg24 suggested that we move Kokkos::initialize/finalize to UnitTestMain.cpp.
I've tried to do this. I've moved the Kokkos::initialize/finalize to UnitTestMain.cpp and then removed it everywhere from the tests (not only the new one in #267, but all tests).
The issue is then that some of the tools print to std::cout as part of their finalize callback. And so when we move Kokkos::finalize to main, hence after the conclusion of the test body, the test can no longer check this output. This leads to failure in test_space_time_stack_demangling.
I'm not sure how to solve it best. For "space time stack", we can move the printing functionality from the destructor of State to a print function. But then it wouldn't be clear how to call this function. An option may be to make State a singleton.
Currently, in the tests,
Kokkosis initialised and finalised in each test body.In
@dalg24 suggested that we move
Kokkos::initialize/finalizetoUnitTestMain.cpp.I've tried to do this. I've moved the
Kokkos::initialize/finalizetoUnitTestMain.cppand then removed it everywhere from the tests (not only the new one in #267, but all tests).The issue is then that some of the tools print to
std::coutas part of theirfinalizecallback. And so when we moveKokkos::finalizetomain, hence after the conclusion of the test body, the test can no longer check this output. This leads to failure intest_space_time_stack_demangling.I'm not sure how to solve it best. For "space time stack", we can move the printing functionality from the destructor of
Stateto aprintfunction. But then it wouldn't be clear how to call this function. An option may be to makeStatea singleton.