#include "gromacs/gpu_utils/devicebuffer.h"
#include "gromacs/gpu_utils/vectype_ops.cuh"
#include "gromacs/math/vec.h"
+#include "gromacs/mdtypes/group.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/pbc_aiuc_cuda.cuh"
#include "gromacs/utility/arrayref.h"
freeDeviceBuffer(&d_inverseMasses_);
}
-void LeapFrogGpu::set(const t_mdatoms& md, const int numTempScaleValues, const unsigned short* tempScaleGroups)
+void LeapFrogGpu::set(const int numAtoms,
+ const real* inverseMasses,
+ const int numTempScaleValues,
+ const unsigned short* tempScaleGroups)
{
- numAtoms_ = md.nr;
+ numAtoms_ = numAtoms;
kernelLaunchConfig_.gridSize[0] = (numAtoms_ + c_threadsPerBlock - 1) / c_threadsPerBlock;
numTempScaleValues_ = numTempScaleValues;
reallocateDeviceBuffer(&d_inverseMasses_, numAtoms_, &numInverseMasses_,
&numInverseMassesAlloc_, deviceContext_);
- copyToDeviceBuffer(&d_inverseMasses_, (float*)md.invmass, 0, numAtoms_, deviceStream_,
+ copyToDeviceBuffer(&d_inverseMasses_, (float*)inverseMasses, 0, numAtoms_, deviceStream_,
GpuApiCallBehavior::Sync, nullptr);
// Temperature scale group map only used if there are more then one group
#ifndef GMX_MDLIB_LEAPFROG_GPU_CUH
#define GMX_MDLIB_LEAPFROG_GPU_CUH
-#include "gromacs/gpu_utils/device_context.h"
#include "gromacs/gpu_utils/gputraits.cuh"
#include "gromacs/gpu_utils/hostallocator.h"
-#include "gromacs/mdtypes/group.h"
-#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/pbc_aiuc.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/classhelpers.h"
+class DeviceContext;
+class DeviceStream;
+struct t_grp_tcstat;
+
namespace gmx
{
* and temperature coupling groups. Copies inverse masses and temperature coupling groups
* to the GPU.
*
- * \param[in] md MD atoms, from which inverse masses are taken.
+ * \param[in] numAtoms Number of atoms in the system.
+ * \param[in] inverseMasses Inverse masses of atoms.
* \param[in] numTempScaleValues Number of temperature scale groups.
* \param[in] tempScaleGroups Maps the atom index to temperature scale value.
*/
- void set(const t_mdatoms& md, int numTempScaleValues, const unsigned short* tempScaleGroups);
+ void set(const int numAtoms,
+ const real* inverseMasses,
+ int numTempScaleValues,
+ const unsigned short* tempScaleGroups);
/*! \brief Class with hardware-specific interfaces and implementations.*/
class Impl;
auto integrator = std::make_unique<LeapFrogGpu>(deviceContext, deviceStream);
- integrator->set(testData->mdAtoms_, testData->numTCoupleGroups_, testData->mdAtoms_.cTC);
+ integrator->set(testData->numAtoms_, testData->inverseMasses_.data(),
+ testData->numTCoupleGroups_, testData->mdAtoms_.cTC);
bool doTempCouple = testData->numTCoupleGroups_ > 0;
for (int step = 0; step < numSteps; step++)
#include "gromacs/mdlib/lincs_gpu.cuh"
#include "gromacs/mdlib/settle_gpu.cuh"
#include "gromacs/mdlib/update_constrain_gpu.h"
+#include "gromacs/mdtypes/mdatom.h"
namespace gmx
{
&numInverseMassesAlloc_, deviceContext_);
// Integrator should also update something, but it does not even have a method yet
- integrator_->set(md, numTempScaleValues, md.cTC);
- lincsGpu_->set(idef, md.nr, md.invmass);
+ integrator_->set(numAtoms_, md.invmass, numTempScaleValues, md.cTC);
+ lincsGpu_->set(idef, numAtoms_, md.invmass);
settleGpu_->set(idef);
coordinateScalingKernelLaunchConfig_.gridSize[0] =