When KOKKOS has been compiled with GPU support the GPU *must* be used

This commit is contained in:
Axel Kohlmeyer
2024-07-30 10:35:15 -04:00
parent bd2e071ef0
commit a5a0620dca
5 changed files with 93 additions and 14 deletions

View File

@ -253,6 +253,15 @@ protected:
{
LAMMPS::argv args = {"LAMMPS_test", "-log", "none", "-echo", "none", "-screen", "none",
"-k", "on", "t", "1", "-sf", "kk"};
// when GPU support is enabled in KOKKOS, it *must* be used
if (Info::has_accelerator_feature("KOKKOS", "api", "hip") ||
Info::has_accelerator_feature("KOKKOS", "api", "cuda") ||
Info::has_accelerator_feature("KOKKOS", "api", "sycl")) {
args = {"LAMMPS_test", "-log", "none", "-echo", "none", "-screen", "none", "-k",
"on", "t", "1", "g", "1", "-sf", "kk"};
}
if (Info::has_accelerator_feature("KOKKOS", "api", "openmp")) args[10] = "2";
if (LAMMPS::is_installed_pkg("KOKKOS")) {