{
assert((gmxForceCalculator_->forcerec_ && "Forcerec not initialized"));
gmxForceCalculator_->forcerec_->nbfp = nonbondedParameters_;
- snew(gmxForceCalculator_->forcerec_->shift_vec, numShiftVectors);
+ gmxForceCalculator_->forcerec_->shift_vec.resize(numShiftVectors);
calc_shifts(box, gmxForceCalculator_->forcerec_->shift_vec);
}
gmx::ArrayRef<const int> shift = nlist.shift;
gmx::ArrayRef<const int> gid = nlist.gid;
- const real* shiftvec = fr.shift_vec[0];
+ const auto shiftvec = fr.shift_vec;
const int ntype = fr.ntype;
gmx::ArrayRef<const real> nbfp = fr.nbfp;
gmx::ArrayRef<const real> nbfp_grid = fr.ljpme_c6grid;
{
int npair_within_cutoff = 0;
- const int is3 = 3 * shift[n];
- const real shX = shiftvec[is3];
- const real shY = shiftvec[is3 + 1];
- const real shZ = shiftvec[is3 + 2];
+ const int is = shift[n];
+ const int is3 = DIM * is;
+ const real shX = shiftvec[is][XX];
+ const real shY = shiftvec[is][YY];
+ const real shZ = shiftvec[is][ZZ];
const int nj0 = jindex[n];
const int nj1 = jindex[n + 1];
const int ii = iinr[n];
forcerec->forceHelperBuffers.emplace_back(haveDirectVirialContributions);
}
- if (forcerec->shift_vec == nullptr)
+ if (forcerec->shift_vec.empty())
{
- snew(forcerec->shift_vec, SHIFTS);
+ forcerec->shift_vec.resize(SHIFTS);
}
if (forcerec->nbfp.empty())
t_forcerec::~t_forcerec()
{
/* Note: This code will disappear when types are converted to C++ */
- sfree(shift_vec);
sfree(ewc_t);
}
PbcType pbcType)
{
/* The short-range virial from surrounding boxes */
- const rvec* fshift = as_rvec_array(forceWithShiftForces.shiftForces().data());
- calc_vir(SHIFTS, fr->shift_vec, fshift, vir_part, pbcType == PbcType::Screw, box);
+ const rvec* fshift = as_rvec_array(forceWithShiftForces.shiftForces().data());
+ const rvec* shiftVecPointer = as_rvec_array(fr->shift_vec.data());
+ calc_vir(SHIFTS, shiftVecPointer, fshift, vir_part, pbcType == PbcType::Screw, box);
inc_nrnb(nrnb, eNR_VIRIAL, SHIFTS);
/* Calculate partial virial, for local atoms only, based on short range.
#include "gromacs/math/vectypes.h"
#include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/real.h"
/* Information about atom properties for local and non-local atoms */
std::vector<int> cginfo;
- rvec* shift_vec = nullptr;
+ std::vector<gmx::RVec> shift_vec;
std::unique_ptr<gmx::WholeMoleculeTransform> wholeMoleculeTransform;
}
/* Copies the shift vector array to nbnxn_atomdata_t */
-void nbnxn_atomdata_copy_shiftvec(gmx_bool bDynamicBox, rvec* shift_vec, nbnxn_atomdata_t* nbat)
+void nbnxn_atomdata_copy_shiftvec(gmx_bool bDynamicBox, gmx::ArrayRef<gmx::RVec> shift_vec, nbnxn_atomdata_t* nbat)
{
nbat->bDynamicBox = bDynamicBox;
- for (int i = 0; i < SHIFTS; i++)
- {
- copy_rvec(shift_vec[i], nbat->shift_vec[i]);
- }
+ std::copy(shift_vec.begin(), shift_vec.end(), nbat->shift_vec.begin());
}
// This is slightly different from nbnxn_get_atom_range(...) at the end of the file
gmx::ArrayRef<const int> atomInfo);
//! Copy the shift vectors to nbat
-void nbnxn_atomdata_copy_shiftvec(gmx_bool dynamic_box, rvec* shift_vec, nbnxn_atomdata_t* nbat);
+void nbnxn_atomdata_copy_shiftvec(gmx_bool dynamic_box,
+ gmx::ArrayRef<gmx::RVec> shift_vec,
+ nbnxn_atomdata_t* nbat);
/*! \brief Transform coordinates to xbat layout
*
forceRec.ntype = numAtomTypes;
forceRec.nbfp = nonbondedParameters;
- snew(forceRec.shift_vec, SHIFTS);
+ forceRec.shift_vec.resize(SHIFTS);
calc_shifts(box, forceRec.shift_vec);
if (!outputFile.empty())
{
* \param[out] vVdw Output buffer for Van der Waals energies
* \param[in] wcycle Pointer to cycle counting data structure.
*/
-static void nbnxn_kernel_cpu(const PairlistSet& pairlistSet,
- const Nbnxm::KernelSetup& kernelSetup,
- nbnxn_atomdata_t* nbat,
- const interaction_const_t& ic,
- rvec* shiftVectors,
- const gmx::StepWorkload& stepWork,
- int clearF,
- real* vCoulomb,
- real* vVdw,
- gmx_wallcycle* wcycle)
+static void nbnxn_kernel_cpu(const PairlistSet& pairlistSet,
+ const Nbnxm::KernelSetup& kernelSetup,
+ nbnxn_atomdata_t* nbat,
+ const interaction_const_t& ic,
+ gmx::ArrayRef<const gmx::RVec> shiftVectors,
+ const gmx::StepWorkload& stepWork,
+ int clearF,
+ real* vCoulomb,
+ real* vVdw,
+ gmx_wallcycle* wcycle)
{
const nbnxn_atomdata_t::Params& nbatParams = nbat->params();
gmx::ArrayRef<const NbnxnPairlistCpu> pairlists = pairlistSet.cpuLists();
+ auto shiftVecPointer = as_rvec_array(shiftVectors.data());
+
int gmx_unused nthreads = gmx_omp_nthreads_get(emntNonbonded);
wallcycle_sub_start(wcycle, ewcsNONBONDED_CLEAR);
#pragma omp parallel for schedule(static) num_threads(nthreads)
switch (kernelSetup.kernelType)
{
case Nbnxm::KernelType::Cpu4x4_PlainC:
- nbnxn_kernel_noener_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxn_kernel_noener_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#ifdef GMX_NBNXN_SIMD_2XNN
case Nbnxm::KernelType::Cpu4xN_Simd_2xNN:
- nbnxm_kernel_noener_simd_2xmm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_noener_simd_2xmm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
#ifdef GMX_NBNXN_SIMD_4XN
case Nbnxm::KernelType::Cpu4xN_Simd_4xN:
- nbnxm_kernel_noener_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_noener_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
default: GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
switch (kernelSetup.kernelType)
{
case Nbnxm::KernelType::Cpu4x4_PlainC:
- nbnxn_kernel_ener_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxn_kernel_ener_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#ifdef GMX_NBNXN_SIMD_2XNN
case Nbnxm::KernelType::Cpu4xN_Simd_2xNN:
- nbnxm_kernel_ener_simd_2xmm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_ener_simd_2xmm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
#ifdef GMX_NBNXN_SIMD_4XN
case Nbnxm::KernelType::Cpu4xN_Simd_4xN:
- nbnxm_kernel_ener_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_ener_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
default: GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
{
case Nbnxm::KernelType::Cpu4x4_PlainC:
unrollj = c_nbnxnCpuIClusterSize;
- nbnxn_kernel_energrp_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxn_kernel_energrp_ref[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#ifdef GMX_NBNXN_SIMD_2XNN
case Nbnxm::KernelType::Cpu4xN_Simd_2xNN:
unrollj = GMX_SIMD_REAL_WIDTH / 2;
- nbnxm_kernel_energrp_simd_2xmm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_energrp_simd_2xmm[coulkt][vdwkt](
+ pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
#ifdef GMX_NBNXN_SIMD_4XN
case Nbnxm::KernelType::Cpu4xN_Simd_4xN:
unrollj = GMX_SIMD_REAL_WIDTH;
- nbnxm_kernel_energrp_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVectors, out);
+ nbnxm_kernel_energrp_simd_4xm[coulkt][vdwkt](pairlist, nbat, &ic, shiftVecPointer, out);
break;
#endif
default: GMX_RELEASE_ASSERT(false, "Unsupported kernel architecture");
static constexpr int c_clSize = c_nbnxnGpuClusterSize;
-void nbnxn_kernel_gpu_ref(const NbnxnPairlistGpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const interaction_const_t* iconst,
- rvec* shift_vec,
- const gmx::StepWorkload& stepWork,
- int clearF,
- gmx::ArrayRef<real> f,
- real* fshift,
- real* Vc,
- real* Vvdw)
+void nbnxn_kernel_gpu_ref(const NbnxnPairlistGpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ const interaction_const_t* iconst,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ const gmx::StepWorkload& stepWork,
+ int clearF,
+ gmx::ArrayRef<real> f,
+ real* fshift,
+ real* Vc,
+ real* Vvdw)
{
real fscal = NAN;
real vcoul = 0;
const int* type = nbat->params().type.data();
const real facel = iconst->epsfac;
- const real* shiftvec = shift_vec[0];
const real* vdwparam = nbat->params().nbfp.data();
const int ntype = nbat->params().numTypes;
for (const nbnxn_sci_t& nbln : nbl->sci)
{
- const int ish3 = 3 * nbln.shift;
- const real shX = shiftvec[ish3];
- const real shY = shiftvec[ish3 + 1];
- const real shZ = shiftvec[ish3 + 2];
+ const int ish = nbln.shift;
+ const int ish3 = DIM * ish;
+ const real shX = shiftvec[ish][XX];
+ const real shY = shiftvec[ish][YY];
+ const real shZ = shiftvec[ish][ZZ];
const int cj4_ind0 = nbln.cj4_ind_start;
const int cj4_ind1 = nbln.cj4_ind_end;
const int sci = nbln.sci;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2018 by the GROMACS development team.
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
//! Reference (slow) kernel for nb n vs n GPU type pair lists
-void nbnxn_kernel_gpu_ref(const NbnxnPairlistGpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const interaction_const_t* iconst,
- rvec* shift_vec,
- const gmx::StepWorkload& stepWork,
- int clearF,
- gmx::ArrayRef<real> f,
- real* fshift,
- real* Vc,
- real* Vvdw);
+void nbnxn_kernel_gpu_ref(const NbnxnPairlistGpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ const interaction_const_t* iconst,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ const gmx::StepWorkload& stepWork,
+ int clearF,
+ gmx::ArrayRef<real> f,
+ real* fshift,
+ real* Vc,
+ real* Vvdw);
#endif
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/utility/gmxassert.h"
/* Prune a single NbnxnPairlistCpu entry with distance rlistInner */
-void nbnxn_kernel_prune_ref(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner)
+void nbnxn_kernel_prune_ref(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ real rlistInner)
{
/* We avoid push_back() for efficiency reasons and resize after filling */
nbl->ci.resize(nbl->ciOuter.size());
const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data();
nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data();
- const real* gmx_restrict shiftvec = shift_vec[0];
- const real* gmx_restrict x = nbat->x().data();
+ const real* gmx_restrict x = nbat->x().data();
const real rlist2 = rlistInner * rlistInner;
{
for (int d = 0; d < DIM; d++)
{
- xi[i * c_xiStride + d] =
- x[(ci * c_iUnroll + i) * c_xStride + d] + shiftvec[ish * DIM + d];
+ xi[i * c_xiStride + d] = x[(ci * c_iUnroll + i) * c_xStride + d] + shiftvec[ish][d];
}
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct nbnxn_atomdata_t;
struct NbnxnPairlistCpu;
+namespace gmx
+{
+template<typename>
+class ArrayRef;
+}
/*! \brief Prune a single NbnxnPairlistCpu entry with distance \p rlistInner
*
* Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
* all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
*/
-void nbnxn_kernel_prune_ref(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner);
+void nbnxn_kernel_prune_ref(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ real rlistInner);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#endif
/* Prune a single nbnxn_pairtlist_t entry with distance rlistInner */
-void nbnxn_kernel_prune_2xnn(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner)
+void nbnxn_kernel_prune_2xnn(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ real rlistInner)
{
#ifdef GMX_NBNXN_SIMD_2XNN
using namespace gmx;
const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data();
nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data();
- const real* gmx_restrict shiftvec = shift_vec[0];
- const real* gmx_restrict x = nbat->x().data();
+ const real* gmx_restrict x = nbat->x().data();
const SimdReal rlist2_S(rlistInner * rlistInner);
ciInner[nciInner].cj_ind_start = ncjInner;
/* Extract shift data */
- int ish = (ciEntry->shift & NBNXN_CI_SHIFT);
- int ish3 = ish * 3;
- int ci = ciEntry->ci;
+ int ish = (ciEntry->shift & NBNXN_CI_SHIFT);
+ int ci = ciEntry->ci;
- SimdReal shX_S = SimdReal(shiftvec[ish3]);
- SimdReal shY_S = SimdReal(shiftvec[ish3 + 1]);
- SimdReal shZ_S = SimdReal(shiftvec[ish3 + 2]);
+ SimdReal shX_S = SimdReal(shiftvec[ish][XX]);
+ SimdReal shY_S = SimdReal(shiftvec[ish][YY]);
+ SimdReal shZ_S = SimdReal(shiftvec[ish][ZZ]);
# if UNROLLJ <= 4
int scix = ci * STRIDE * DIM;
GMX_UNUSED_VALUE(nbl);
GMX_UNUSED_VALUE(nbat);
- GMX_UNUSED_VALUE(shift_vec);
+ GMX_UNUSED_VALUE(shiftvec);
GMX_UNUSED_VALUE(rlistInner);
#endif /* GMX_NBNXN_SIMD_2XNN */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct nbnxn_atomdata_t;
struct NbnxnPairlistCpu;
+namespace gmx
+{
+template<typename>
+class ArrayRef;
+}
+
/*! \brief Prune a single NbnxnPairlistCpu entry with distance \p rlistInner
*
* Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
* all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
*/
-void nbnxn_kernel_prune_2xnn(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner);
+void nbnxn_kernel_prune_2xnn(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shift_vec,
+ real rlistInner);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#endif
/* Prune a single nbnxn_pairtlist_t entry with distance rlistInner */
-void nbnxn_kernel_prune_4xn(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner)
+void nbnxn_kernel_prune_4xn(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ real rlistInner)
{
#ifdef GMX_NBNXN_SIMD_4XN
using namespace gmx;
const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data();
nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data();
- const real* gmx_restrict shiftvec = shift_vec[0];
- const real* gmx_restrict x = nbat->x().data();
+ const real* gmx_restrict x = nbat->x().data();
const SimdReal rlist2_S(rlistInner * rlistInner);
ciInner[nciInner].cj_ind_start = ncjInner;
/* Extract shift data */
- int ish = (ciEntry->shift & NBNXN_CI_SHIFT);
- int ish3 = ish * 3;
- int ci = ciEntry->ci;
+ int ish = (ciEntry->shift & NBNXN_CI_SHIFT);
+ int ci = ciEntry->ci;
- SimdReal shX_S = SimdReal(shiftvec[ish3]);
- SimdReal shY_S = SimdReal(shiftvec[ish3 + 1]);
- SimdReal shZ_S = SimdReal(shiftvec[ish3 + 2]);
+ SimdReal shX_S = SimdReal(shiftvec[ish][XX]);
+ SimdReal shY_S = SimdReal(shiftvec[ish][YY]);
+ SimdReal shZ_S = SimdReal(shiftvec[ish][ZZ]);
# if UNROLLJ <= 4
int scix = ci * STRIDE * DIM;
GMX_UNUSED_VALUE(nbl);
GMX_UNUSED_VALUE(nbat);
- GMX_UNUSED_VALUE(shift_vec);
+ GMX_UNUSED_VALUE(shiftvec);
GMX_UNUSED_VALUE(rlistInner);
#endif /* GMX_NBNXN_SIMD_4XN */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct nbnxn_atomdata_t;
struct NbnxnPairlistCpu;
+namespace gmx
+{
+template<typename>
+class ArrayRef;
+}
+
/*! \brief Prune a single NbnxnPairlistCpu entry with distance \p rlistInner
*
* Reads a cluster pairlist \p nbl->ciOuter, \p nbl->cjOuter and writes
* all cluster pairs within \p rlistInner to \p nbl->ci, \p nbl->cj.
*/
-void nbnxn_kernel_prune_4xn(NbnxnPairlistCpu* nbl,
- const nbnxn_atomdata_t* nbat,
- const rvec* gmx_restrict shift_vec,
- real rlistInner);
+void nbnxn_kernel_prune_4xn(NbnxnPairlistCpu* nbl,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shiftvec,
+ real rlistInner);
bool isDynamicPruningStepGpu(int64_t step) const;
//! Dispatches the dynamic pruning kernel for the given locality, for CPU lists
- void dispatchPruneKernelCpu(gmx::InteractionLocality iLocality, const rvec* shift_vec) const;
+ void dispatchPruneKernelCpu(gmx::InteractionLocality iLocality,
+ gmx::ArrayRef<const gmx::RVec> shift_vec) const;
//! Dispatches the dynamic pruning kernel for GPU lists
void dispatchPruneKernelGpu(int64_t step);
SearchCycleCounting* searchCycleCounting);
//! Dispatch the kernel for dynamic pairlist pruning
- void dispatchPruneKernel(const nbnxn_atomdata_t* nbat, const rvec* shift_vec);
+ void dispatchPruneKernel(const nbnxn_atomdata_t* nbat, gmx::ArrayRef<const gmx::RVec> shift_vec);
//! Returns the lists of CPU pairlists
gmx::ArrayRef<const NbnxnPairlistCpu> cpuLists() const { return cpuLists_; }
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2012,2013,2014,2015,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
t_nrnb* nrnb);
//! Dispatches the dynamic pruning kernel for the given locality
- void dispatchPruneKernel(gmx::InteractionLocality iLocality,
- const nbnxn_atomdata_t* nbat,
- const rvec* shift_vec);
+ void dispatchPruneKernel(gmx::InteractionLocality iLocality,
+ const nbnxn_atomdata_t* nbat,
+ gmx::ArrayRef<const gmx::RVec> shift_vec);
//! Returns the pair list parameters
const PairlistParams& params() const { return params_; }
void PairlistSets::dispatchPruneKernel(const gmx::InteractionLocality iLocality,
const nbnxn_atomdata_t* nbat,
- const rvec* shift_vec)
+ gmx::ArrayRef<const gmx::RVec> shift_vec)
{
pairlistSet(iLocality).dispatchPruneKernel(nbat, shift_vec);
}
-void PairlistSet::dispatchPruneKernel(const nbnxn_atomdata_t* nbat, const rvec* shift_vec)
+void PairlistSet::dispatchPruneKernel(const nbnxn_atomdata_t* nbat, gmx::ArrayRef<const gmx::RVec> shift_vec)
{
const real rlistInner = params_.rlistInner;
}
void nonbonded_verlet_t::dispatchPruneKernelCpu(const gmx::InteractionLocality iLocality,
- const rvec* shift_vec) const
+ gmx::ArrayRef<const gmx::RVec> shift_vec) const
{
pairlistSets_->dispatchPruneKernel(iLocality, nbat.get(), shift_vec);
}
}
}
-void calc_shifts(const matrix box, rvec shift_vec[])
+void calc_shifts(const matrix box, gmx::ArrayRef<gmx::RVec> shift_vec)
{
for (int n = 0, m = -D_BOX_Z; m <= D_BOX_Z; m++)
{
* \param[in] box The simulation box
* \param[out] shift_vec The shifting vectors
*/
-void calc_shifts(const matrix box, rvec shift_vec[]);
+void calc_shifts(const matrix box, gmx::ArrayRef<gmx::RVec> shift_vec);
/*! \brief Calculates the center of the box.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/vectypes.h"
#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/arrayref.h"
#include "testutils/refdata.h"
// Choose box vector entries whose magnitudes will lead to unique
// shift vector values when the largest box shift in any dimension
// is two.
- const matrix box = { { 0.01, 1, -100 }, { 300, -0.03, 3 }, { -6, -600, 0.06 } };
- rvec shiftVectors[SHIFTS];
+ const matrix box = { { 0.01, 1, -100 }, { 300, -0.03, 3 }, { -6, -600, 0.06 } };
+ std::vector<gmx::RVec> shiftVectors(SHIFTS);
calc_shifts(box, shiftVectors);