* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_cuda_data_mgmt.h"
+
+#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
#include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <cuda.h>
-#include "gmx_fatal.h"
-#include "smalloc.h"
-#include "tables.h"
-#include "typedefs.h"
-#include "types/enums.h"
-#include "types/nb_verlet.h"
-#include "types/interaction_const.h"
-#include "types/force_flags.h"
-#include "../nbnxn_consts.h"
-#include "gmx_detect_hardware.h"
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+#include "gromacs/legacyheaders/gpu_utils.h"
+#include "gromacs/legacyheaders/pmalloc_cuda.h"
+#include "gromacs/legacyheaders/tables.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/common.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#include "nbnxn_cuda_types.h"
-#include "../../gmxlib/cuda_tools/cudautils.cuh"
-#include "nbnxn_cuda_data_mgmt.h"
-#include "pmalloc_cuda.h"
-#include "gpu_utils.h"
-
-#include "gromacs/utility/common.h"
static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
pmalloc((void**)&ftmp, tabsize*sizeof(*ftmp));
table_spline3_fill_ewald_lr(ftmp, NULL, NULL, tabsize,
- 1/tabscale, nbp->ewald_beta);
+ 1/tabscale, nbp->ewald_beta, v_q_ewald_lr);
/* If the table pointer == NULL the table is generated the first time =>
the array pointer will be saved to nbparam and the texture is bound.
return kernel_type;
}
-
-/*! Initializes the nonbonded parameter data structure. */
-static void init_nbparam(cu_nbparam_t *nbp,
- const interaction_const_t *ic,
- const nbnxn_atomdata_t *nbat,
- const cuda_dev_info_t *dev_info)
+/*! Copies all parameters related to the cut-off from ic to nbp */
+static void set_cutoff_parameters(cu_nbparam_t *nbp,
+ const interaction_const_t *ic)
{
- cudaError_t stat;
- int ntypes, nnbfp, nnbfp_comb;
-
- ntypes = nbat->ntype;
-
nbp->ewald_beta = ic->ewaldcoeff_q;
nbp->sh_ewald = ic->sh_ewald;
nbp->epsfac = ic->epsfac;
nbp->dispersion_shift = ic->dispersion_shift;
nbp->repulsion_shift = ic->repulsion_shift;
nbp->vdw_switch = ic->vdw_switch;
+}
+
+/*! Initializes the nonbonded parameter data structure. */
+static void init_nbparam(cu_nbparam_t *nbp,
+ const interaction_const_t *ic,
+ const nbnxn_atomdata_t *nbat,
+ const cuda_dev_info_t *dev_info)
+{
+ cudaError_t stat;
+ int ntypes, nnbfp, nnbfp_comb;
+
+ ntypes = nbat->ntype;
+
+ set_cutoff_parameters(nbp, ic);
if (ic->vdwtype == evdwCUT)
{
/*! Re-generate the GPU Ewald force table, resets rlist, and update the
* electrostatic type switching to twin cut-off (or back) if needed. */
-void nbnxn_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t cu_nb,
- const interaction_const_t *ic)
+void nbnxn_cuda_pme_loadbal_update_param(const nonbonded_verlet_t *nbv,
+ const interaction_const_t *ic)
{
- cu_nbparam_t *nbp = cu_nb->nbparam;
+ if (!nbv || nbv->grp[0].kernel_type != nbnxnk8x8x8_CUDA)
+ {
+ return;
+ }
+ nbnxn_cuda_ptr_t cu_nb = nbv->cu_nbv;
+ cu_nbparam_t *nbp = cu_nb->nbparam;
- nbp->rlist_sq = ic->rlist * ic->rlist;
- nbp->rcoulomb_sq = ic->rcoulomb * ic->rcoulomb;
- nbp->ewald_beta = ic->ewaldcoeff_q;
+ set_cutoff_parameters(nbp, ic);
nbp->eeltype = pick_ewald_kernel_type(ic->rcoulomb != ic->rvdw,
cu_nb->dev_info);
* priorities, because we are querying the priority range which in this
* case will be a single value.
*/
-#if CUDA_VERSION >= 5500
+#if CUDA_VERSION >= 5050
{
int highest_priority;
stat = cudaDeviceGetStreamPriorityRange(NULL, &highest_priority);
return (cu_nb != NULL && cu_nb->bDoTime) ? cu_nb->timings : NULL;
}
-void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t cu_nb)
+void nbnxn_cuda_reset_timings(nonbonded_verlet_t* nbv)
{
- if (cu_nb->bDoTime)
+ if (nbv->cu_nbv && nbv->cu_nbv->bDoTime)
{
- init_timings(cu_nb->timings);
+ init_timings(nbv->cu_nbv->timings);
}
}