Skip to content

Call Kokkos::initialize/finalize in UnitTestMain #269

@maartenarnst

Description

@maartenarnst

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions