diff --git a/unittest/force-styles/test_angle_style.cpp b/unittest/force-styles/test_angle_style.cpp index e07ec3b689..ebd8170b7c 100644 --- a/unittest/force-styles/test_angle_style.cpp +++ b/unittest/force-styles/test_angle_style.cpp @@ -537,6 +537,10 @@ TEST(AngleStyle, kokkos_omp) if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", "-sf", "kk"}; diff --git a/unittest/force-styles/test_bond_style.cpp b/unittest/force-styles/test_bond_style.cpp index 39316ec035..4a3a985ffc 100644 --- a/unittest/force-styles/test_bond_style.cpp +++ b/unittest/force-styles/test_bond_style.cpp @@ -539,6 +539,10 @@ TEST(BondStyle, kokkos_omp) if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", "-sf", "kk"}; diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index deda7ffbfd..b538c45f42 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -541,6 +541,10 @@ TEST(DihedralStyle, kokkos_omp) if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index 7d12d0b20c..069f07abad 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -857,6 +857,10 @@ TEST(FixTimestep, kokkos_omp) if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", "-sf", "kk"}; diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index bddb986d9c..cddb27a2f7 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -533,6 +533,10 @@ TEST(ImproperStyle, kokkos_omp) { if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", diff --git a/unittest/force-styles/test_pair_style.cpp b/unittest/force-styles/test_pair_style.cpp index 884d802aa5..bb1346fe70 100644 --- a/unittest/force-styles/test_pair_style.cpp +++ b/unittest/force-styles/test_pair_style.cpp @@ -633,6 +633,10 @@ TEST(PairStyle, kokkos_omp) if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP(); if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP(); if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP(); + // if KOKKOS has GPU support enabled, it *must* be used. We cannot test OpenMP only. + if (Info::has_accelerator_feature("KOKKOS", "api", "cuda") || + Info::has_accelerator_feature("KOKKOS", "api", "hip") || + Info::has_accelerator_feature("KOKKOS", "api", "sycl")) GTEST_SKIP(); LAMMPS::argv args = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-k", "on", "t", "4", "-sf", "kk"};