Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CUDAKernels.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2011 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: CUDAKernels.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.50 $        $Date: 2011/11/21 17:56:18 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   Wrapper for CUDA kernels and utility functions
00019  *   used by the CUDAAccel C++ class 
00020  ***************************************************************************/
00021 #ifndef CUDAKERNELS_H
00022 #define CUDAKERNELS_H
00023 
00024 #include "WKFThreads.h"
00025 
00026 /* avoid parameter name collisions with AIX5 "hz" macro */
00027 #undef hz
00028 
00029 #if defined(__cplusplus)
00030 extern "C" {
00031 #endif
00032 
00033 /* 
00034  * number of CUDA devices available 
00035  */
00036 #define VMDCUDA_ERR_NONE          0
00037 #define VMDCUDA_ERR_GENERAL      -1
00038 #define VMDCUDA_ERR_NODEVICES    -2
00039 #define VMDCUDA_ERR_SOMEDEVICES  -3
00040 #define VMDCUDA_ERR_DRVMISMATCH  -4
00041 #define VMDCUDA_ERR_EMUDEVICE    -5
00042 int vmd_cuda_num_devices(int *numdev);
00043 
00044 /* replicate CUDA compute mode enumerations */
00045 #define VMDCUDA_COMPUTEMODE_DEFAULT     0
00046 #define VMDCUDA_COMPUTEMODE_EXCLUSIVE   1
00047 #define VMDCUDA_COMPUTEMODE_PROHIBITED  2
00048 
00049 /* 
00050  * retrieve device properties 
00051  */
00052 int vmd_cuda_device_props(int dev, char *name, int namelen,
00053                           int *revmajor, int *revminor, 
00054                           unsigned long *memb, int *clockratekhz,
00055                           int *smcount, int *overlap, int *kerneltimeout,
00056                           int *canmaphostmem, int *computemode);
00057 
00058 
00059 /*
00060  * All available CUDA kernels
00061  */
00062 void * vmd_cuda_devpool_setdevice(void * voidparms);
00063 
00064 void * vmd_cuda_devpool_clear_device_mem(void *);
00065 
00066 int vmd_cuda_madd_gflops(int numdevs, int *devlist, double *gflops, 
00067                          int testloops);
00068 
00069 int vmd_cuda_bus_bw(int numdevs, int *devlist, 
00070                     double *hdmbsec, double *hdlatusec,
00071                     double *phdmbsec, double *phdlatusec,
00072                     double *dhmbsec, double *dhlatusec,
00073                     double *pdhmbsec, double *pdhlatusec);
00074 
00075 int vmd_cuda_globmem_bw(int numdevs, int *devlist, 
00076                         double *memsetgbsec, double *memcpygbsec);
00077 
00078 int vmd_cuda_devpool_latency(wkf_threadpool_t *devpool, int tilesize,
00079                              double *kernlaunchlatency,
00080                              double *barlatency,
00081                              double *cyclelatency, 
00082                              double *tilelatency,
00083                              double *kernellatency);
00084 
00085 int vmd_cuda_measure_latencies(wkf_threadpool_t *devpool);
00086 
00087 int vmd_cuda_vol_cpotential(long int natoms, float* atoms, float* grideners, 
00088                             long int numplane, long int numcol, long int numpt, 
00089                             float gridspacing);
00090 
00091 int vmd_cuda_quicksurf(long int natoms, const float *xyzr, const float *colors,
00092                        int colorperatom, 
00093                        float *origin, int *numvoxels, float maxrad,
00094                        float radscale, float gridspacing, 
00095                        float isovalue, float gausslim,
00096                        int &numverts,
00097                        float *&v,
00098                        float *&n,
00099                        float *&c,
00100                        int &numfacets,
00101                        int *&f);
00102 
00103 int vmd_cuda_evaluate_orbital_grid(wkf_threadpool_t *devpool,
00104                        int numatoms,
00105                        const float *wave_f, int num_wave_f,
00106                        const float *basis_array, int num_basis,
00107                        const float *atompos,
00108                        const int *atom_basis,
00109                        const int *num_shells_per_atom,
00110                        const int *num_prim_per_shell,
00111                        const int *shell_types,
00112                        int num_shells,
00113                        const int *numvoxels,
00114                        float voxelsize,
00115                        const float *origin,
00116                        int density,
00117                        float *orbitalgrid);
00118 
00119 int vmd_cuda_evaluate_occupancy_map(
00120     int mx, int my, int mz,             // map dimensions
00121     float *map,                         // buffer space for occupancy map
00122                                         // (length mx*my*mz floats)
00123 
00124     float max_energy,                   // max energy threshold
00125     float cutoff,                       // vdw cutoff distance
00126     float hx, float hy, float hz,       // map lattice spacing
00127     float x0, float y0, float z0,       // map origin
00128     float bx_1, float by_1, float bz_1, // inverse of atom bin lengths
00129 
00130     int nbx, int nby, int nbz,          // bin dimensions
00131     const float *bin,                   // atom bins XXX typecast to flint
00132                                         // (length BIN_SIZE*nbx*nby*nbz)
00133     const float *bin_zero,              // bin pointer shifted to origin
00134 
00135     int num_binoffsets,                 // number of offsets
00136     const char *binoffsets,             // bin neighborhood index offsets
00137                                         // (length 3*num_bin_offsets)
00138 
00139     int num_extras,                     // number of extra atoms
00140     const float *extra,                 // extra atoms from overfilled bins
00141                                         // XXX typecast to flint
00142                                         // (length BIN_SLOTSIZE*num_extras)
00143 
00144     int num_vdwparms,                   // number of vdw parameter types
00145     const float *vdwparms,              // vdw parameters
00146                                         // (length 2*num_vdw_params)
00147 
00148     int num_probes,                     // number of probe atoms
00149     const float *probevdwparms,         // vdw parameters of probe atoms
00150                                         // (length 2*num_probes)
00151 
00152     int num_conformers,                 // number of conformers
00153     const float *conformers             // probe atom offsets for conformers
00154                                         // (length 3*num_probes*num_conformers)
00155     );
00156 
00157 
00158 int rdf_gpu(wkf_threadpool_t *devpool, // GPU worker thread pool
00159             int usepbc,                // periodic or non-periodic calc.
00160             int natoms1,               // array of the number of atoms in
00161                                        // selection 1 in each frame.
00162             float* xyz,                // coordinates of first selection.
00163                                        // [natoms1][3]
00164             int natoms2,               // array of the number of atoms in
00165                                        // selection 2 in each frame.
00166             float* xyz2,               // coordinates of selection 2.
00167                                        // [natoms2][3]
00168             float* cell,               // the cell x y and z dimensions [3]
00169             float* hist,               // the histograms, 1 per block
00170                                        // [ncudablocks][maxbin]
00171             int maxbin,                // the number of bins in the histogram
00172             float rmin,                // the minimum value of the first bin
00173             float delr);               // the width of each bin
00174 
00175 
00176 #if defined(__cplusplus)
00177 }
00178 #endif
00179 
00180 #endif
00181 

Generated on Sat May 26 01:47:50 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002