diff --git a/src/input.cpp b/src/input.cpp index 835b8ae5c9..ca440d2e28 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -808,23 +808,20 @@ void Input::accelerator() if (domain->box_exist) error->all("Accelerator command after simulation box is defined"); if (narg < 1) error->all("Illegal accelerator command"); - if (!lmp->asuffix || (strcmp(lmp->asuffix,arg[0]) != 0)) - error->all("Accelerator command requires matching command-line -a switch"); if (strcmp(arg[0],"off") == 0) { if (narg != 1) error->all("Illegal accelerator command"); lmp->accelerator = 0; return; - } - - if (strcmp(arg[0],"on") == 0) { + } else if (strcmp(arg[0],"on") == 0) { if (narg != 1) error->all("Illegal accelerator command"); lmp->accelerator = 1; return; - } - - if (strcmp(arg[0],"cuda") == 0) lmp->cuda->accelerator(narg-1,&arg[1]); - else error->all("Illegal accelerator command"); + } else if (strcmp(arg[0],"cuda") == 0) { + if (!lmp->cuda) error->all("Accelerator cuda command without " + "USER-CUDA package installed"); + lmp->cuda->accelerator(narg-1,&arg[1]); + } else error->all("Illegal accelerator command"); } /* ---------------------------------------------------------------------- */ diff --git a/src/lammps.cpp b/src/lammps.cpp index dfef210734..bc3134d5d0 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -50,8 +50,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) screen = NULL; logfile = NULL; - // create CUDA class - // cuda = true version if USER-CUDA installed, else dummy + // create CUDA class if USER-CUDA installed, else dummy cuda = new Cuda(this); if (!cuda->cuda_exists) {