use introspection to check for Kokkos::OpenMP only when it is enabled

This commit is contained in:
Axel Kohlmeyer
2022-02-03 16:08:00 -05:00
parent 6bfb7a5521
commit 2a7823686d

View File

@ -261,12 +261,12 @@ protected:
int argc = sizeof(args) / sizeof(char *);
// only run this test fixture with kk suffix if KOKKOS package is installed
// also need to figure out a way to find which parallelizations are enabled
if (LAMMPS::is_installed_pkg("KOKKOS")) {
::testing::internal::CaptureStdout();
lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD);
std::string output = ::testing::internal::GetCapturedStdout();
if (LAMMPS::Info::has_accelerator_feature("KOKKOS", "api", "openmp"))
EXPECT_THAT(output, StartsWith("Kokkos::OpenMP::"));
} else
GTEST_SKIP();