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

« back to all changes in this revision

Viewing changes to lib/cuda/pair_cg_cmm_coul_long_cuda.cu

  • 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:
1
 
/* ----------------------------------------------------------------------
2
 
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3
 
 
4
 
   Original Version:
5
 
   http://lammps.sandia.gov, Sandia National Laboratories
6
 
   Steve Plimpton, sjplimp@sandia.gov
7
 
 
8
 
   See the README file in the top-level LAMMPS directory.
9
 
 
10
 
   -----------------------------------------------------------------------
11
 
 
12
 
   USER-CUDA Package and associated modifications:
13
 
   https://sourceforge.net/projects/lammpscuda/
14
 
 
15
 
   Christian Trott, christian.trott@tu-ilmenau.de
16
 
   Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
17
 
   Theoretical Physics II, University of Technology Ilmenau, Germany
18
 
 
19
 
   See the README file in the USER-CUDA directory.
20
 
 
21
 
   This software is distributed under the GNU General Public License.
22
 
------------------------------------------------------------------------- */
23
 
 
24
 
#include <stdio.h>
25
 
 
26
 
#define _lj1 MY_AP(coeff1)
27
 
#define _lj2 MY_AP(coeff2)
28
 
#define _lj3 MY_AP(coeff3)
29
 
#define _lj4 MY_AP(coeff4)
30
 
#define _cg_type MY_AP(coeff5)
31
 
 
32
 
 
33
 
#include "pair_cg_cmm_coul_long_cuda_cu.h"
34
 
#include <time.h>
35
 
 
36
 
 
37
 
 
38
 
 
39
 
void Cuda_PairCGCMMCoulLongCuda_Init(cuda_shared_data* sdata)
40
 
{
41
 
  Cuda_Pair_Init_AllStyles(sdata, 5, true, false);
42
 
 
43
 
}
44
 
 
45
 
 
46
 
 
47
 
 
48
 
void Cuda_PairCGCMMCoulLongCuda(cuda_shared_data* sdata, cuda_shared_neighlist* sneighlist, int eflag, int vflag, int eflag_atom, int vflag_atom)
49
 
{
50
 
 
51
 
  // initialize only on first call
52
 
  static  short init = 0;
53
 
 
54
 
  if(! init) {
55
 
    init = 1;
56
 
    Cuda_PairCGCMMCoulLongCuda_Init(sdata);
57
 
  }
58
 
 
59
 
  dim3 grid, threads;
60
 
  int sharedperproc;
61
 
 
62
 
  Cuda_Pair_PreKernel_AllStyles(sdata, sneighlist, eflag, vflag, grid, threads, sharedperproc, true, 128);
63
 
 
64
 
  cudaStream_t* streams = (cudaStream_t*) CudaWrapper_returnStreams();
65
 
 
66
 
  if(sdata->pair.use_block_per_atom)
67
 
    Pair_Kernel_BpA<PAIR_CG_CMM, COUL_LONG, DATA_NONE>
68
 
    <<< grid, threads, sharedperproc* sizeof(ENERGY_FLOAT)*threads.x, streams[1]>>> (eflag, vflag, eflag_atom, vflag_atom);
69
 
  else
70
 
    Pair_Kernel_TpA<PAIR_CG_CMM, COUL_LONG, DATA_NONE>
71
 
    <<< grid, threads, sharedperproc* sizeof(ENERGY_FLOAT)*threads.x, streams[1]>>> (eflag, vflag, eflag_atom, vflag_atom);
72
 
 
73
 
  Cuda_Pair_PostKernel_AllStyles(sdata, grid, sharedperproc, eflag, vflag);
74
 
}
75
 
 
76
 
#undef _lj1
77
 
#undef _lj2
78
 
#undef _lj3
79
 
#undef _lj4
80
 
#undef _cg_type
81