ComputePmeCUDAKernel.h File Reference

Go to the source code of this file.

Defines

#define __align__(X)
#define CUDA_PME_CHARGES_PROTOTYPE
#define CUDA_PME_CHARGES_BATCHED_PROTOTYPE
#define CUDA_PME_FORCES_PROTOTYPE

Functions

void cuda_init_bspline_coeffs (float **c, float **dc, int order)

Variables

 CUDA_PME_CHARGES_PROTOTYPE
 CUDA_PME_CHARGES_BATCHED_PROTOTYPE
 CUDA_PME_FORCES_PROTOTYPE

Define Documentation

#define __align__ (  ) 

Definition at line 5 of file ComputePmeCUDAKernel.h.

Value:
void cuda_pme_charges_batched( \
  const float *coeffs, \
  float * const *q_arr, int *f_arr, int *fz_arr, \
  float **a_data_ptr, int* n_atoms_ptr, \
  int* K1_ptr, int* K2_ptr, int* K3_ptr, \
  int order, int numPatches, int n_max_atoms, cudaStream_t stream)

Definition at line 21 of file ComputePmeCUDAKernel.h.

Value:
void cuda_pme_charges( \
  const float *coeffs, \
  float * const *q_arr, int *f_arr, int *fz_arr, \
  float *a_data, int n_atoms, \
  int K1, int K2, int K3, \
  int order, cudaStream_t stream)

Definition at line 10 of file ComputePmeCUDAKernel.h.

Value:
void cuda_pme_forces( \
  const float *coeffs, \
  float * const *q_arr, \
  float * const *afn, int dimy, int maxn, \
  /* float *a_data, float *f_data, int n_atoms, */ \
  int K1, int K2, int K3, \
  int order, cudaStream_t stream)

Definition at line 32 of file ComputePmeCUDAKernel.h.


Function Documentation

void cuda_init_bspline_coeffs ( float **  c,
float **  dc,
int  order 
)

Definition at line 43 of file ComputePmeCUDAKernel.cu.

References j, NAMD_die(), order_4_coeffs, order_6_coeffs, and order_8_coeffs.

Referenced by ComputePmeMgr::initialize_computes().

00043                                                                 {
00044   float *coeffs = new float[order*order];
00045   float *dcoeffs = new float[order*order];
00046   double divisor;
00047   static const float *scoeffs;
00048   switch ( order ) {
00049   case 4:
00050     scoeffs = &order_4_coeffs[0][0];
00051     divisor = 6;
00052     break;
00053   case 6:
00054     scoeffs = &order_6_coeffs[0][0];
00055     divisor = 120;
00056     break;
00057   case 8:
00058     scoeffs = &order_8_coeffs[0][0];
00059     divisor = 5040;
00060     break;
00061   default:
00062     NAMD_die("unsupported PMEInterpOrder");
00063   }
00064   double sum = 0;
00065   for ( int i=0, p=order-1; i<order; ++i,--p ) {
00066     for ( int j=0; j<order; ++j ) {
00067       double c = scoeffs[i*order+(order-1-j)];  // reverse order
00068       sum += c;
00069       c /= divisor;
00070       coeffs[i*order+j] = c;
00071       dcoeffs[i*order+j] = (double)p * c;
00072       // printf("%d %d %f %f\n", i, j, c, (double)p*c);
00073     }
00074   }
00075   // printf("checksum: %f %f\n", sum, divisor);
00076   if ( sum != divisor )
00077     NAMD_die("cuda_init_bspline_coeffs static data checksum error");
00078   cudaMalloc((void**) c, order*order*sizeof(float));
00079   cudaMalloc((void**) dc, order*order*sizeof(float));
00080   cudaMemcpy(*c, coeffs, order*order*sizeof(float), cudaMemcpyHostToDevice);
00081   cudaMemcpy(*dc, dcoeffs, order*order*sizeof(float), cudaMemcpyHostToDevice);
00082   delete [] coeffs;
00083   delete [] dcoeffs;
00084 }


Variable Documentation

Definition at line 29 of file ComputePmeCUDAKernel.h.

Definition at line 18 of file ComputePmeCUDAKernel.h.

Definition at line 41 of file ComputePmeCUDAKernel.h.


Generated on 15 Sep 2019 for NAMD by  doxygen 1.6.1