~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include "respa.h"
43
43
#include "memory.h"
44
44
#include "error.h"
45
 
#include "cuda.h"
 
45
#include "user_cuda.h"
46
46
 
47
47
using namespace LAMMPS_NS;
48
48
 
69
69
        if(! allocated) PairLJCharmmCoulCharmm::allocate();
70
70
        if(! allocated2)
71
71
        {
72
 
                cuda->accelerator(0,NULL);
73
72
                allocated2 = true;
74
73
                cuda->shared_data.pair.coeff1  = lj1;
75
74
                cuda->shared_data.pair.coeff2  = lj2;
77
76
                cuda->shared_data.pair.coeff4  = lj4;
78
77
                cuda->shared_data.pair.special_lj  = force->special_lj;
79
78
                cuda->shared_data.pair.special_coul  = force->special_coul;
80
 
            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
81
 
            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
82
 
            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
83
 
            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
 
79
            cu_lj1_gm = new cCudaData<double, F_CFLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
 
80
            cu_lj2_gm = new cCudaData<double, F_CFLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
 
81
            cu_lj3_gm = new cCudaData<double, F_CFLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
 
82
            cu_lj4_gm = new cCudaData<double, F_CFLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
84
83
        }
85
84
}
86
85
 
111
110
void PairLJCharmmCoulCharmmCuda::settings(int narg, char **arg)
112
111
{
113
112
        PairLJCharmmCoulCharmm::settings(narg, arg);
114
 
        cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
115
 
        cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
116
 
        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
 
113
        cuda->shared_data.pair.cut_global = (X_CFLOAT) cut_lj;
 
114
        cuda->shared_data.pair.cut_coulsq_global = (X_CFLOAT) cut_coulsq;
 
115
        cuda->shared_data.pair.cut_inner_global = (F_CFLOAT) cut_lj_inner;
117
116
}
118
117
 
119
118
/* ---------------------------------------------------------------------- */
137
136
 
138
137
  int irequest;
139
138
 
140
 
           irequest = neighbor->request(this);
 
139
  irequest = neighbor->request(this,instance_me);
141
140
    neighbor->requests[irequest]->full = 1;
142
141
    neighbor->requests[irequest]->half = 0;
143
142
    neighbor->requests[irequest]->cudable = 1;
181
180
        PairLJCharmmCoulCharmm::ev_setup(eflag,vflag);
182
181
 
183
182
  if (eflag_atom && atom->nmax > maxeatomold)
184
 
        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
183
        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_CFLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
185
184
 
186
185
  if (vflag_atom && atom->nmax > maxeatomold)
187
 
        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
186
        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_CFLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
188
187
 
189
188
}