git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6218 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2011-05-26 22:15:18 +00:00
parent 0ca2e3b389
commit cfa91c0611
3 changed files with 6 additions and 14 deletions

View File

@ -29,7 +29,7 @@
#else #else
// dummy interface to USER-CUDA // dummy interface to USER-CUDA
// used when USER-CUDA is not installed // needed for compiling when USER-CUDA is not installed
#include "comm.h" #include "comm.h"
#include "modify.h" #include "modify.h"
@ -41,11 +41,9 @@ class Cuda {
public: public:
int cuda_exists; int cuda_exists;
int oncpu; int oncpu;
int neighbor_decide_by_integrator;
Cuda(class LAMMPS *) {cuda_exists = 0;} Cuda(class LAMMPS *) {cuda_exists = 0;}
~Cuda() {} ~Cuda() {}
void setDevice(class LAMMPS *) {}
void accelerator(int, char **) {} void accelerator(int, char **) {}
void evsetup_eatom_vatom(int, int) {} void evsetup_eatom_vatom(int, int) {}
void downloadAll() {} void downloadAll() {}

View File

@ -30,14 +30,12 @@
#include "force.h" #include "force.h"
#include "dump.h" #include "dump.h"
#include "write_restart.h" #include "write_restart.h"
#include "accelerator_cuda.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
#include "accelerator.h"
using namespace LAMMPS_NS; using namespace LAMMPS_NS;
enum{NOACCEL,OPT,GPU,USERCUDA}; // same as lammps.cpp
#define DELTA 1 #define DELTA 1
#define MYMIN(a,b) ((a) < (b) ? (a) : (b)) #define MYMIN(a,b) ((a) < (b) ? (a) : (b))
@ -250,8 +248,7 @@ void Output::write(bigint ntimestep)
if (next_dump_any == ntimestep) { if (next_dump_any == ntimestep) {
if (lmp->accelerator == USERCUDA && !lmp->cuda->oncpu) if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();
lmp->cuda->downloadAll();
for (int idump = 0; idump < ndump; idump++) { for (int idump = 0; idump < ndump; idump++) {
if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) { if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
@ -279,8 +276,7 @@ void Output::write(bigint ntimestep)
if (next_restart == ntimestep && last_restart != ntimestep) { if (next_restart == ntimestep && last_restart != ntimestep) {
if (lmp->accelerator == USERCUDA && !lmp->cuda->oncpu) if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();
lmp->cuda->downloadAll();
if (restart_toggle == 0) { if (restart_toggle == 0) {
char *file = new char[strlen(restart1) + 16]; char *file = new char[strlen(restart1) + 16];

View File

@ -30,7 +30,7 @@
#include "comm.h" #include "comm.h"
#include "force.h" #include "force.h"
#include "update.h" #include "update.h"
#include "accelerator.h" #include "accelerator_cuda.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
@ -41,7 +41,6 @@ using namespace LAMMPS_NS;
enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};
enum{R,RSQ,BMP}; enum{R,RSQ,BMP};
enum{NOACCEL,OPT,GPU,USERCUDA}; // same as lammps.cpp
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -328,8 +327,7 @@ void Pair::ev_setup(int eflag, int vflag)
if (vflag_either == 0 && eflag_either == 0) evflag = 0; if (vflag_either == 0 && eflag_either == 0) evflag = 0;
} else vflag_fdotr = 0; } else vflag_fdotr = 0;
if (lmp->accelerator == USERCUDA) if (lmp->cuda) lmp->cuda->evsetup_eatom_vatom(eflag_atom,vflag_atom);
lmp->cuda->evsetup_eatom_vatom(eflag_atom,vflag_atom);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------