changa  3.5
 All Classes Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
EwaldCUDA.h
1 #ifndef _EWALD_CUDA_H_
2 #define _EWALD_CUDA_H_
3 
4 #include "HostCUDA.h"
5 
6 /* defines for Hybrid API buffer indices */
7 
8 #define EWALD_READ_ONLY_DATA 0
9 #define EWALD_TABLE 1
10 
11 /* Defines for place in the hapiBufferInfo array */
12 #define PARTICLE_TABLE_IDX 0
13 #define EWALD_READ_ONLY_DATA_IDX 1
14 #define EWALD_TABLE_IDX 2
15 
16 #define NEWH 80
17 #define BLOCK_SIZE 128
18 
19 /* See "defines for Hybrid API buffer indices" in HostCUDA.h for this
20  * number. */
21 #define NUM_GRAVITY_BUFS 5
22 
25 typedef struct {
26  cudatype hx, hy, hz;
27  cudatype hCfac, hSfac;
28 } EwtData;
29 
32 typedef struct {
33 #ifndef HEXADECAPOLE
34  cudatype xx, xy, xz, yy, yz, zz;
35 #endif
36  cudatype totalMass;
37  cudatype cmx, cmy, cmz;
38 
40 
43 typedef struct {
44  cudatype m;
45  cudatype xx,yy,xy,xz,yz;
46  cudatype xxx,xyy,xxy,yyy,xxz,yyz,xyz;
47  cudatype xxxx,xyyy,xxxy,yyyy,xxxz,yyyz,xxyy,xxyz,xyyz;
48  cudatype zz;
49  cudatype xzz,yzz,zzz;
50  cudatype xxzz,xyzz,xzzz,yyzz,yzzz,zzzz;
51 } MomcData;
52 
55 typedef struct {
57  MomcData momcRoot;
58 
59  int n, nReps, nEwReps, nEwhLoop;
60  cudatype L, fEwCut, alpha, alpha2, k1, ka, fEwCut2, fInner2;
61 
63 
65 typedef struct {
66  int EwaldRange[2];
68  int *EwaldMarkers;
71 } EwaldData;
72 
73 void EwaldHostMemorySetup(EwaldData *h_idata, int size, int nEwhLoop, int largephase);
74 void EwaldHostMemoryFree(EwaldData *h_idata, int largephase);
75 #ifdef HAPI_INSTRUMENT_WRS
76 void EwaldHost(EwaldData *h_idata, void *cb, int myIndex, char phase, int largephase);
77 #else
78 void EwaldHost(EwaldData *h_idata, void *cb, int myIndex, int largephase);
79 #endif
80 
81 __global__ void EwaldKernel(CompactPartData *particleCores, VariablePartData *particleVars, int *markers, int largephase, int First, int Last);
82 
83 #endif
84 
Parameters and data for Ewald in the CUDA kernel.
Definition: EwaldCUDA.h:55
Particle data that gets calculated by the GPU.
Definition: cuda_typedef.h:259
float cudatype
floating point type on the GPU
Definition: cuda_typedef.h:12
Data for the Ewald h loop in the CUDA kernel.
Definition: EwaldCUDA.h:25
Particle data needed on the GPU to calculate gravity.
Definition: cuda_typedef.h:231
EwtData * ewt
Definition: EwaldCUDA.h:69
CUDA version of MOMC for Ewald.
Definition: EwaldCUDA.h:43
EwaldReadOnlyData * cachedData
Definition: EwaldCUDA.h:70
structure to hold information specific to GPU Ewald
Definition: EwaldCUDA.h:65
int * EwaldMarkers
Definition: EwaldCUDA.h:68
CUDA version of complete MultipoleMoments for Ewald.
Definition: EwaldCUDA.h:32