First set of changes for Kokkos HIP

This commit is contained in:
Stan Moore
2020-08-04 12:16:26 -05:00
parent 6576c4cbf3
commit ed566bf6af
101 changed files with 131 additions and 112 deletions

View File

@ -100,8 +100,8 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
} else if (strcmp(arg[iarg],"g") == 0 ||
strcmp(arg[iarg],"gpus") == 0) {
#ifndef KOKKOS_ENABLE_CUDA
error->all(FLERR,"GPUs are requested but Kokkos has not been compiled for CUDA");
#if !defined(KOKKOS_ENABLE_CUDA) && !defined(KOKKOS_ENABLE_HIP)
error->all(FLERR,"GPUs are requested but Kokkos has not been compiled for CUDA or HIP");
#endif
if (iarg+2 > narg) error->all(FLERR,"Invalid Kokkos command-line args");
ngpus = atoi(arg[iarg+1]);
@ -164,9 +164,9 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
if (logfile) fprintf(logfile," will use up to %d GPU(s) per node\n",ngpus);
}
#ifdef KOKKOS_ENABLE_CUDA
#ifdef LMP_KOKKOS_GPU
if (ngpus <= 0)
error->all(FLERR,"Kokkos has been compiled for CUDA but no GPUs are requested");
error->all(FLERR,"Kokkos has been compiled for CUDA or HIP but no GPUs are requested");
#endif
#ifndef KOKKOS_ENABLE_SERIAL