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

« back to all changes in this revision

Viewing changes to src/USER-INTEL/pair_sw_intel.h

  • 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
/* -*- c++ -*- ----------------------------------------------------------
 
2
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
3
   http://lammps.sandia.gov, Sandia National Laboratories
 
4
   Steve Plimpton, sjplimp@sandia.gov
 
5
 
 
6
   Copyright (2003) Sandia Corporation.  Under the terms of Contract
 
7
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
 
8
   certain rights in this software.  This software is distributed under
 
9
   the GNU General Public License.
 
10
 
 
11
   See the README file in the top-level LAMMPS directory.
 
12
------------------------------------------------------------------------- */
 
13
 
 
14
#ifdef PAIR_CLASS
 
15
 
 
16
PairStyle(sw/intel,PairSWIntel)
 
17
 
 
18
#else
 
19
 
 
20
#ifndef LMP_PAIR_SW_INTEL_H
 
21
#define LMP_PAIR_SW_INTEL_H
 
22
 
 
23
#include "pair_sw.h"
 
24
#include "fix_intel.h"
 
25
 
 
26
namespace LAMMPS_NS {
 
27
 
 
28
class PairSWIntel : public PairSW {
 
29
 public:
 
30
  PairSWIntel(class LAMMPS *);
 
31
  virtual ~PairSWIntel();
 
32
  virtual void compute(int, int);
 
33
  virtual void init_style();
 
34
 
 
35
 protected:
 
36
  FixIntel *fix;
 
37
  int _cop;
 
38
  template <class flt_t> class ForceConst;
 
39
 
 
40
  virtual void allocate();
 
41
 
 
42
  template <class flt_t, class acc_t>
 
43
  void compute(int eflag, int vflag, IntelBuffers<flt_t,acc_t> *buffers,
 
44
               const ForceConst<flt_t> &fc);
 
45
  template <int SPQ, int EVFLAG, int EFLAG, class flt_t, class acc_t>
 
46
  void eval(const int offload, const int vflag,
 
47
            IntelBuffers<flt_t,acc_t> * buffers, const ForceConst<flt_t> &fc, 
 
48
            const int astart, const int aend, const int pad_width);
 
49
 
 
50
  template <class flt_t, class acc_t>
 
51
  void pack_force_const(ForceConst<flt_t> &fc,
 
52
                        IntelBuffers<flt_t, acc_t> *buffers);
 
53
 
 
54
  int _ccache_stride, _host_pad, _offload_pad, _spq;
 
55
 
 
56
  // ----------------------------------------------------------------------
 
57
 
 
58
  template <class flt_t>
 
59
  class ForceConst {
 
60
   public:
 
61
    typedef struct {
 
62
      flt_t cutsq, cut, sigma_gamma, pad;
 
63
    } fc_packed0;
 
64
    typedef struct {
 
65
      flt_t powerp, powerq, cut, sigma, c1, c2, c3, c4;
 
66
    } fc_packed1;
 
67
    typedef struct {
 
68
      flt_t c5, c6;
 
69
    } fc_packed2;
 
70
    typedef struct {
 
71
      flt_t costheta, lambda_epsilon, lambda_epsilon2, pad;
 
72
    } fc_packed3;
 
73
 
 
74
    fc_packed0 **p2;
 
75
    fc_packed1 **p2f;
 
76
    fc_packed2 **p2e;
 
77
    fc_packed3 ***p3;
 
78
 
 
79
    ForceConst() : _ntypes(0)  {}
 
80
    ~ForceConst() { set_ntypes(0, NULL, _cop); }
 
81
 
 
82
    void set_ntypes(const int ntypes, Memory *memory, const int cop);
 
83
 
 
84
   private:
 
85
    int _ntypes, _cop;
 
86
    Memory *_memory;
 
87
  };
 
88
  ForceConst<float> force_const_single;
 
89
  ForceConst<double> force_const_double;
 
90
};
 
91
 
 
92
}
 
93
 
 
94
#endif
 
95
#endif
 
96
 
 
97
/* ERROR/WARNING messages:
 
98
 
 
99
E: The 'package intel' command is required for /intel styles
 
100
 
 
101
Self-explanatory.
 
102
 
 
103
E: The 'ghost no' option cannot be used with sw/intel.
 
104
 
 
105
Self-explanatory.
 
106
 
 
107
E: Intel compiler versions before 15 Update 1 not supported for sw/intel.
 
108
 
 
109
Self-explanatory.
 
110
 
 
111
*/