This is to folow general naming conventions across the code.
Refs #3114.
Change-Id: Iec3678e1d4152d6442818fcd81020e021927757c
leapfrog_gpu.cu
lincs_gpu.cu
settle_gpu.cu
- update_constrain_cuda_impl.cu
+ update_constrain_gpu_impl.cu
)
endif()
*/
/*! \libinternal \file
*
- * \brief Declaration of high-level functions of CUDA implementation of update and constrain class.
- *
- * \todo Change "cuda" suffix to "gpu"
+ * \brief Declaration of high-level functions of GPU implementation of update and constrain class.
*
* \author Artem Zhmurov <zhmurov@gmail.com>
*
* \ingroup module_mdlib
* \inlibraryapi
*/
-#ifndef GMX_MDLIB_UPDATE_CONSTRAIN_CUDA_H
-#define GMX_MDLIB_UPDATE_CONSTRAIN_CUDA_H
+#ifndef GMX_MDLIB_UPDATE_CONSTRAIN_GPU_H
+#define GMX_MDLIB_UPDATE_CONSTRAIN_GPU_H
#include "gromacs/gpu_utils/devicebuffer_datatype.h"
#include "gromacs/mdtypes/group.h"
namespace gmx
{
-class UpdateConstrainCuda
+class UpdateConstrainGpu
{
public:
* \param[in] commandStream GPU stream to use. Can be nullptr.
* \param[in] xUpdatedOnDevice The event synchronizer to use to mark that update is done on the GPU.
*/
- UpdateConstrainCuda(const t_inputrec& ir,
- const gmx_mtop_t& mtop,
- const void* commandStream,
- GpuEventSynchronizer* xUpdatedOnDevice);
+ UpdateConstrainGpu(const t_inputrec& ir,
+ const gmx_mtop_t& mtop,
+ const void* commandStream,
+ GpuEventSynchronizer* xUpdatedOnDevice);
- ~UpdateConstrainCuda();
+ ~UpdateConstrainGpu();
/*! \brief Integrate
*
/*! \brief
* Returns whether the maximum number of coupled constraints is supported
- * by the CUDA LINCS code.
+ * by the GPU LINCS code.
*
* \param[in] mtop The molecular topology
*/
} // namespace gmx
-#endif
+#endif // GMX_MDLIB_UPDATE_CONSTRAIN_GPU_H
#include "config.h"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
#if GMX_GPU != GMX_GPU_CUDA
namespace gmx
{
-class UpdateConstrainCuda::Impl
+class UpdateConstrainGpu::Impl
{
};
-UpdateConstrainCuda::UpdateConstrainCuda(const t_inputrec& /* ir */,
- const gmx_mtop_t& /* mtop */,
- const void* /* commandStream */,
- GpuEventSynchronizer* /* xUpdatedOnDevice */) :
+UpdateConstrainGpu::UpdateConstrainGpu(const t_inputrec& /* ir */,
+ const gmx_mtop_t& /* mtop */,
+ const void* /* commandStream */,
+ GpuEventSynchronizer* /* xUpdatedOnDevice */) :
impl_(nullptr)
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
}
-UpdateConstrainCuda::~UpdateConstrainCuda() = default;
+UpdateConstrainGpu::~UpdateConstrainGpu() = default;
-void UpdateConstrainCuda::integrate(GpuEventSynchronizer* /* fReadyOnDevice */,
- const real /* dt */,
- const bool /* updateVelocities */,
- const bool /* computeVirial */,
- tensor /* virialScaled */,
- const bool /* doTemperatureScaling */,
- gmx::ArrayRef<const t_grp_tcstat> /* tcstat */,
- const bool /* doParrinelloRahman */,
- const float /* dtPressureCouple */,
- const matrix /* prVelocityScalingMatrix*/)
+void UpdateConstrainGpu::integrate(GpuEventSynchronizer* /* fReadyOnDevice */,
+ const real /* dt */,
+ const bool /* updateVelocities */,
+ const bool /* computeVirial */,
+ tensor /* virialScaled */,
+ const bool /* doTemperatureScaling */,
+ gmx::ArrayRef<const t_grp_tcstat> /* tcstat */,
+ const bool /* doParrinelloRahman */,
+ const float /* dtPressureCouple */,
+ const matrix /* prVelocityScalingMatrix*/)
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
}
-void UpdateConstrainCuda::scaleCoordinates(const matrix /* scalingMatrix */)
+void UpdateConstrainGpu::scaleCoordinates(const matrix /* scalingMatrix */)
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
}
-void UpdateConstrainCuda::set(DeviceBuffer<float> /* d_x */,
- DeviceBuffer<float> /* d_v */,
- const DeviceBuffer<float> /* d_f */,
- const t_idef& /* idef */,
- const t_mdatoms& /* md */,
- const int /* numTempScaleValues */)
+void UpdateConstrainGpu::set(DeviceBuffer<float> /* d_x */,
+ DeviceBuffer<float> /* d_v */,
+ const DeviceBuffer<float> /* d_f */,
+ const t_idef& /* idef */,
+ const t_mdatoms& /* md */,
+ const int /* numTempScaleValues */)
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
}
-void UpdateConstrainCuda::setPbc(const PbcType /* pbcType */, const matrix /* box */)
+void UpdateConstrainGpu::setPbc(const PbcType /* pbcType */, const matrix /* box */)
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
}
-GpuEventSynchronizer* UpdateConstrainCuda::getCoordinatesReadySync()
+GpuEventSynchronizer* UpdateConstrainGpu::getCoordinatesReadySync()
{
GMX_ASSERT(false,
"A CPU stub for UpdateConstrain was called instead of the correct implementation.");
return nullptr;
}
-bool UpdateConstrainCuda::isNumCoupledConstraintsSupported(const gmx_mtop_t& /* mtop */)
+bool UpdateConstrainGpu::isNumCoupledConstraintsSupported(const gmx_mtop_t& /* mtop */)
{
return false;
}
*/
#include "gmxpre.h"
-#include "update_constrain_cuda_impl.h"
+#include "update_constrain_gpu_impl.h"
#include <assert.h>
#include <stdio.h>
#include "gromacs/mdlib/leapfrog_gpu.cuh"
#include "gromacs/mdlib/lincs_gpu.cuh"
#include "gromacs/mdlib/settle_gpu.cuh"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
namespace gmx
{
}
}
-void UpdateConstrainCuda::Impl::integrate(GpuEventSynchronizer* fReadyOnDevice,
- const real dt,
- const bool updateVelocities,
- const bool computeVirial,
- tensor virial,
- const bool doTemperatureScaling,
- gmx::ArrayRef<const t_grp_tcstat> tcstat,
- const bool doParrinelloRahman,
- const float dtPressureCouple,
- const matrix prVelocityScalingMatrix)
+void UpdateConstrainGpu::Impl::integrate(GpuEventSynchronizer* fReadyOnDevice,
+ const real dt,
+ const bool updateVelocities,
+ const bool computeVirial,
+ tensor virial,
+ const bool doTemperatureScaling,
+ gmx::ArrayRef<const t_grp_tcstat> tcstat,
+ const bool doParrinelloRahman,
+ const float dtPressureCouple,
+ const matrix prVelocityScalingMatrix)
{
// Clearing virial matrix
// TODO There is no point in having separate virial matrix for constraints
return;
}
-void UpdateConstrainCuda::Impl::scaleCoordinates(const matrix scalingMatrix)
+void UpdateConstrainGpu::Impl::scaleCoordinates(const matrix scalingMatrix)
{
ScalingMatrix mu;
mu.xx = scalingMatrix[XX][XX];
gpuStreamSynchronize(commandStream_);
}
-UpdateConstrainCuda::Impl::Impl(const t_inputrec& ir,
- const gmx_mtop_t& mtop,
- const void* commandStream,
- GpuEventSynchronizer* xUpdatedOnDevice) :
+UpdateConstrainGpu::Impl::Impl(const t_inputrec& ir,
+ const gmx_mtop_t& mtop,
+ const void* commandStream,
+ GpuEventSynchronizer* xUpdatedOnDevice) :
coordinatesReady_(xUpdatedOnDevice)
{
GMX_ASSERT(xUpdatedOnDevice != nullptr, "The event synchronizer can not be nullptr.");
coordinateScalingKernelLaunchConfig_.stream = commandStream_;
}
-UpdateConstrainCuda::Impl::~Impl() {}
+UpdateConstrainGpu::Impl::~Impl() {}
-void UpdateConstrainCuda::Impl::set(DeviceBuffer<float> d_x,
- DeviceBuffer<float> d_v,
- const DeviceBuffer<float> d_f,
- const t_idef& idef,
- const t_mdatoms& md,
- const int numTempScaleValues)
+void UpdateConstrainGpu::Impl::set(DeviceBuffer<float> d_x,
+ DeviceBuffer<float> d_v,
+ const DeviceBuffer<float> d_f,
+ const t_idef& idef,
+ const t_mdatoms& md,
+ const int numTempScaleValues)
{
GMX_ASSERT(d_x != nullptr, "Coordinates device buffer should not be null.");
GMX_ASSERT(d_v != nullptr, "Velocities device buffer should not be null.");
(numAtoms_ + c_threadsPerBlock - 1) / c_threadsPerBlock;
}
-void UpdateConstrainCuda::Impl::setPbc(const PbcType pbcType, const matrix box)
+void UpdateConstrainGpu::Impl::setPbc(const PbcType pbcType, const matrix box)
{
setPbcAiuc(numPbcDimensions(pbcType), box, &pbcAiuc_);
}
-GpuEventSynchronizer* UpdateConstrainCuda::Impl::getCoordinatesReadySync()
+GpuEventSynchronizer* UpdateConstrainGpu::Impl::getCoordinatesReadySync()
{
return coordinatesReady_;
}
-UpdateConstrainCuda::UpdateConstrainCuda(const t_inputrec& ir,
- const gmx_mtop_t& mtop,
- const void* commandStream,
- GpuEventSynchronizer* xUpdatedOnDevice) :
+UpdateConstrainGpu::UpdateConstrainGpu(const t_inputrec& ir,
+ const gmx_mtop_t& mtop,
+ const void* commandStream,
+ GpuEventSynchronizer* xUpdatedOnDevice) :
impl_(new Impl(ir, mtop, commandStream, xUpdatedOnDevice))
{
}
-UpdateConstrainCuda::~UpdateConstrainCuda() = default;
-
-void UpdateConstrainCuda::integrate(GpuEventSynchronizer* fReadyOnDevice,
- const real dt,
- const bool updateVelocities,
- const bool computeVirial,
- tensor virialScaled,
- const bool doTemperatureScaling,
- gmx::ArrayRef<const t_grp_tcstat> tcstat,
- const bool doParrinelloRahman,
- const float dtPressureCouple,
- const matrix prVelocityScalingMatrix)
+UpdateConstrainGpu::~UpdateConstrainGpu() = default;
+
+void UpdateConstrainGpu::integrate(GpuEventSynchronizer* fReadyOnDevice,
+ const real dt,
+ const bool updateVelocities,
+ const bool computeVirial,
+ tensor virialScaled,
+ const bool doTemperatureScaling,
+ gmx::ArrayRef<const t_grp_tcstat> tcstat,
+ const bool doParrinelloRahman,
+ const float dtPressureCouple,
+ const matrix prVelocityScalingMatrix)
{
impl_->integrate(fReadyOnDevice, dt, updateVelocities, computeVirial, virialScaled, doTemperatureScaling,
tcstat, doParrinelloRahman, dtPressureCouple, prVelocityScalingMatrix);
}
-void UpdateConstrainCuda::scaleCoordinates(const matrix scalingMatrix)
+void UpdateConstrainGpu::scaleCoordinates(const matrix scalingMatrix)
{
impl_->scaleCoordinates(scalingMatrix);
}
-void UpdateConstrainCuda::set(DeviceBuffer<float> d_x,
- DeviceBuffer<float> d_v,
- const DeviceBuffer<float> d_f,
- const t_idef& idef,
- const t_mdatoms& md,
- const int numTempScaleValues)
+void UpdateConstrainGpu::set(DeviceBuffer<float> d_x,
+ DeviceBuffer<float> d_v,
+ const DeviceBuffer<float> d_f,
+ const t_idef& idef,
+ const t_mdatoms& md,
+ const int numTempScaleValues)
{
impl_->set(d_x, d_v, d_f, idef, md, numTempScaleValues);
}
-void UpdateConstrainCuda::setPbc(const PbcType pbcType, const matrix box)
+void UpdateConstrainGpu::setPbc(const PbcType pbcType, const matrix box)
{
impl_->setPbc(pbcType, box);
}
-GpuEventSynchronizer* UpdateConstrainCuda::getCoordinatesReadySync()
+GpuEventSynchronizer* UpdateConstrainGpu::getCoordinatesReadySync()
{
return impl_->getCoordinatesReadySync();
}
-bool UpdateConstrainCuda::isNumCoupledConstraintsSupported(const gmx_mtop_t& mtop)
+bool UpdateConstrainGpu::isNumCoupledConstraintsSupported(const gmx_mtop_t& mtop)
{
return LincsGpu::isNumCoupledConstraintsSupported(mtop);
}
*/
/*! \internal \file
*
- * \brief Declares CUDA implementation class for update and constraints.
+ * \brief Declares GPU implementation class for update and constraints.
*
* This header file is needed to include from both the device-side
* kernels file, and the host-side management code.
*
* \ingroup module_mdlib
*/
-#ifndef GMX_MDLIB_UPDATE_CONSTRAIN_CUDA_IMPL_H
-#define GMX_MDLIB_UPDATE_CONSTRAIN_CUDA_IMPL_H
+#ifndef GMX_MDLIB_UPDATE_CONSTRAIN_GPU_IMPL_H
+#define GMX_MDLIB_UPDATE_CONSTRAIN_GPU_IMPL_H
#include "gmxpre.h"
#include "gromacs/mdlib/leapfrog_gpu.cuh"
#include "gromacs/mdlib/lincs_gpu.cuh"
#include "gromacs/mdlib/settle_gpu.cuh"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdtypes/inputrec.h"
namespace gmx
{
-/*! \internal \brief Class with interfaces and data for CUDA version of Update-Constraint. */
-class UpdateConstrainCuda::Impl
+/*! \internal \brief Class with interfaces and data for GPU version of Update-Constraint. */
+class UpdateConstrainGpu::Impl
{
public:
/*! \brief
* Returns whether the maximum number of coupled constraints is supported
- * by the CUDA LINCS code.
+ * by the GPU LINCS code.
*
* \param[in] mtop The molecular topology
*/
static bool isNumCoupledConstraintsSupported(const gmx_mtop_t& mtop);
private:
- //! CUDA stream
+ //! GPU stream
CommandStream commandStream_ = nullptr;
- //! CUDA kernel launch config
+ //! GPU kernel launch config
KernelLaunchConfig coordinateScalingKernelLaunchConfig_;
//! Periodic boundary data
//! Leap-Frog integrator
std::unique_ptr<LeapFrogGpu> integrator_;
- //! LINCS CUDA object to use for non-water constraints
+ //! LINCS GPU object to use for non-water constraints
std::unique_ptr<LincsGpu> lincsGpu_;
- //! SETTLE CUDA object for water constrains
+ //! SETTLE GPU object for water constrains
std::unique_ptr<SettleGpu> settleGpu_;
//! An pointer to the event to indicate when the update of coordinates is complete
} // namespace gmx
-#endif
+#endif // GMX_MDLIB_UPDATE_CONSTRAIN_GPU_IMPL_H
#include "gromacs/mdlib/tgroup.h"
#include "gromacs/mdlib/trajectory_writing.h"
#include "gromacs/mdlib/update.h"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdlib/vcm.h"
#include "gromacs/mdlib/vsite.h"
#include "gromacs/mdrunutility/handlerestart.h"
auto mdatoms = mdAtoms->mdatoms();
- std::unique_ptr<UpdateConstrainCuda> integrator;
+ std::unique_ptr<UpdateConstrainGpu> integrator;
if (DOMAINDECOMP(cr))
{
{
GMX_LOG(mdlog.info).asParagraph().appendText("Updating coordinates on the GPU.");
}
- integrator = std::make_unique<UpdateConstrainCuda>(
+ integrator = std::make_unique<UpdateConstrainGpu>(
*ir, *top_global, stateGpu->getUpdateStream(), stateGpu->xUpdatedOnDevice());
integrator->setPbc(PbcType::Xyz, state->box);
#include "gromacs/hardware/hardwaretopology.h"
#include "gromacs/hardware/hw_info.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
{
errorMessage += "Non-connecting constraints are not supported";
}
- if (!UpdateConstrainCuda::isNumCoupledConstraintsSupported(mtop))
+ if (!UpdateConstrainGpu::isNumCoupledConstraintsSupported(mtop))
{
errorMessage +=
- "The number of coupled constraints is higher than supported in the CUDA LINCS "
+ "The number of coupled constraints is higher than supported in the GPU LINCS "
"code.\n";
}