Rename LeapFrogCuda to LeapFrogGpu
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 9 Jan 2020 16:26:49 +0000 (17:26 +0100)
committerChristian Blau <cblau@gerrit.gromacs.org>
Mon, 20 Jan 2020 14:14:38 +0000 (15:14 +0100)
This is to folow general naming conventions across the code.

Refs #2887, #2888.

Change-Id: Ia090c0479f1960fe34d1144e3bd173015d157e62

src/gromacs/mdlib/CMakeLists.txt
src/gromacs/mdlib/leapfrog_gpu.cu [moved from src/gromacs/mdlib/leapfrog_cuda.cu with 92% similarity]
src/gromacs/mdlib/leapfrog_gpu.cuh [moved from src/gromacs/mdlib/leapfrog_cuda.cuh with 93% similarity]
src/gromacs/mdlib/tests/leapfrogtestrunners.cu
src/gromacs/mdlib/tests/leapfrogtestrunners.h
src/gromacs/mdlib/update_constrain_cuda_impl.cu
src/gromacs/mdlib/update_constrain_cuda_impl.h

index c773589452c973d3538f191fd3487122967b1e73..f7d2f579d0fe1b2a590aa83a7ac36fefb387d322 100644 (file)
@@ -43,7 +43,7 @@ if(GMX_USE_CUDA)
     gmx_add_libgromacs_sources(
        lincs_cuda.cu
        settle_cuda.cu
-       leapfrog_cuda.cu
+       leapfrog_gpu.cu
        update_constrain_cuda_impl.cu
        )
 endif()
similarity index 92%
rename from src/gromacs/mdlib/leapfrog_cuda.cu
rename to src/gromacs/mdlib/leapfrog_gpu.cu
index ac4135960740aea0c45f4e8db8deb27856b2db45..61bc231e3660262406ed3e8ef49c79595a1fa040 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
  * using CUDA, including class initialization, data-structures management
  * and GPU kernel.
  *
- * \todo Reconsider naming towards using "gpu" suffix instead of "cuda".
- *
  * \author Artem Zhmurov <zhmurov@gmail.com>
  *
  * \ingroup module_mdlib
  */
 #include "gmxpre.h"
 
-#include "leapfrog_cuda.cuh"
+#include "leapfrog_gpu.cuh"
 
 #include <assert.h>
 #include <stdio.h>
@@ -262,16 +260,16 @@ inline auto selectLeapFrogKernelPtr(bool                doTemperatureScaling,
     return kernelPtr;
 }
 
-void LeapFrogCuda::integrate(const float3*                     d_x,
-                             float3*                           d_xp,
-                             float3*                           d_v,
-                             const float3*                     d_f,
-                             const real                        dt,
-                             const bool                        doTemperatureScaling,
-                             gmx::ArrayRef<const t_grp_tcstat> tcstat,
-                             const bool                        doParrinelloRahman,
-                             const float                       dtPressureCouple,
-                             const matrix                      prVelocityScalingMatrix)
+void LeapFrogGpu::integrate(const float3*                     d_x,
+                            float3*                           d_xp,
+                            float3*                           d_v,
+                            const float3*                     d_f,
+                            const real                        dt,
+                            const bool                        doTemperatureScaling,
+                            gmx::ArrayRef<const t_grp_tcstat> tcstat,
+                            const bool                        doParrinelloRahman,
+                            const float                       dtPressureCouple,
+                            const matrix                      prVelocityScalingMatrix)
 {
 
     ensureNoPendingCudaError("In CUDA version of Leap-Frog integrator");
@@ -318,7 +316,7 @@ void LeapFrogCuda::integrate(const float3*                     d_x,
     return;
 }
 
-LeapFrogCuda::LeapFrogCuda(CommandStream commandStream) : commandStream_(commandStream)
+LeapFrogGpu::LeapFrogGpu(CommandStream commandStream) : commandStream_(commandStream)
 {
     numAtoms_ = 0;
 
@@ -331,12 +329,12 @@ LeapFrogCuda::LeapFrogCuda(CommandStream commandStream) : commandStream_(command
     kernelLaunchConfig_.stream           = commandStream_;
 }
 
-LeapFrogCuda::~LeapFrogCuda()
+LeapFrogGpu::~LeapFrogGpu()
 {
     freeDeviceBuffer(&d_inverseMasses_);
 }
 
-void LeapFrogCuda::set(const t_mdatoms& md, const int numTempScaleValues, const unsigned short* tempScaleGroups)
+void LeapFrogGpu::set(const t_mdatoms& md, const int numTempScaleValues, const unsigned short* tempScaleGroups)
 {
     numAtoms_                       = md.nr;
     kernelLaunchConfig_.gridSize[0] = (numAtoms_ + c_threadsPerBlock - 1) / c_threadsPerBlock;
similarity index 93%
rename from src/gromacs/mdlib/leapfrog_cuda.cuh
rename to src/gromacs/mdlib/leapfrog_gpu.cuh
index cbf3738a8f82e6270f4363b67b29acba725f4583..ba6d1be3f209437744959e4fbe18de8ddc4bb649 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
  */
 /*! \libinternal \file
  *
- * \brief Declarations for CUDA implementation of Leap-Frog.
- *
- * \todo Reconsider naming towards using "gpu" suffix instead of "cuda".
+ * \brief Declarations for GPU implementation of Leap-Frog.
  *
  * \author Artem Zhmurov <zhmurov@gmail.com>
  *
  * \ingroup module_mdlib
  * \inlibraryapi
  */
-#ifndef GMX_MDLIB_LEAPFROG_CUDA_CUH
-#define GMX_MDLIB_LEAPFROG_CUDA_CUH
+#ifndef GMX_MDLIB_LEAPFROG_GPU_CUH
+#define GMX_MDLIB_LEAPFROG_GPU_CUH
 
 #include "gromacs/gpu_utils/gputraits.cuh"
 #include "gromacs/gpu_utils/hostallocator.h"
@@ -58,7 +56,7 @@
 namespace gmx
 {
 
-class LeapFrogCuda
+class LeapFrogGpu
 {
 
 public:
@@ -66,8 +64,8 @@ public:
      *
      * \param[in] commandStream  Device command stream to use.
      */
-    LeapFrogCuda(CommandStream commandStream);
-    ~LeapFrogCuda();
+    LeapFrogGpu(CommandStream commandStream);
+    ~LeapFrogGpu();
 
     /*! \brief Integrate
      *
@@ -112,9 +110,9 @@ public:
     class Impl;
 
 private:
-    //! CUDA stream
+    //! GPU stream
     CommandStream commandStream_;
-    //! CUDA kernel launch config
+    //! GPU kernel launch config
     KernelLaunchConfig kernelLaunchConfig_;
     //! Number of atoms
     int numAtoms_;
index 34bd6a2685b6bdd848562eb4a5ca24aa17f990ec..df88a1b6e0c4b78dd656e7794251e13a69c73c48 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
@@ -57,7 +57,7 @@
 #include "gromacs/gpu_utils/devicebuffer.cuh"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/math/vec.h"
-#include "gromacs/mdlib/leapfrog_cuda.cuh"
+#include "gromacs/mdlib/leapfrog_gpu.cuh"
 #include "gromacs/mdlib/stat.h"
 #include "gromacs/mdtypes/group.h"
 
@@ -89,7 +89,7 @@ void integrateLeapFrogGpu(LeapFrogTestData* testData, int numSteps)
     copyToDeviceBuffer(&d_v, h_v, 0, numAtoms, nullptr, GpuApiCallBehavior::Sync, nullptr);
     copyToDeviceBuffer(&d_f, h_f, 0, numAtoms, nullptr, GpuApiCallBehavior::Sync, nullptr);
 
-    auto integrator = std::make_unique<LeapFrogCuda>(nullptr);
+    auto integrator = std::make_unique<LeapFrogGpu>(nullptr);
 
     integrator->set(testData->mdAtoms_, testData->numTCoupleGroups_, testData->mdAtoms_.cTC);
 
index a47534e08a35d72a121cadf012212f49f514d956..bef6c49d1ab65f31c7beed5029db0992b4aee2df 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
@@ -58,7 +58,7 @@ namespace test
  */
 void integrateLeapFrogSimple(LeapFrogTestData* testData, int numSteps);
 
-/*! \brief Integrate using CUDA version of Leap-Frog
+/*! \brief Integrate using GPU version of Leap-Frog
  *
  * Copies data from CPU to GPU, integrates the equation of motion
  * for requested number of steps using Leap-Frog algorithm, copies
index fce3117c8ed66d002910a097d6dbc19b1a3538e9..3d36b7794c5921e2054dc4c13f0ab6f1033e48ce 100644 (file)
@@ -60,7 +60,7 @@
 #include "gromacs/gpu_utils/devicebuffer.h"
 #include "gromacs/gpu_utils/gputraits.cuh"
 #include "gromacs/gpu_utils/vectype_ops.cuh"
-#include "gromacs/mdlib/leapfrog_cuda.cuh"
+#include "gromacs/mdlib/leapfrog_gpu.cuh"
 #include "gromacs/mdlib/lincs_cuda.cuh"
 #include "gromacs/mdlib/settle_cuda.cuh"
 #include "gromacs/mdlib/update_constrain_cuda.h"
@@ -175,7 +175,7 @@ UpdateConstrainCuda::Impl::Impl(const t_inputrec&     ir,
                              : commandStream_ = nullptr;
 
 
-    integrator_ = std::make_unique<LeapFrogCuda>(commandStream_);
+    integrator_ = std::make_unique<LeapFrogGpu>(commandStream_);
     lincsCuda_  = std::make_unique<LincsCuda>(ir.nLincsIter, ir.nProjOrder, commandStream_);
     settleCuda_ = std::make_unique<SettleCuda>(mtop, commandStream_);
 
index a2caab40ef247b06824f93b28953c84046d779e6..25ac45b586efa28c27e1396c9d9b33a0aa53db3a 100644 (file)
@@ -49,7 +49,7 @@
 #include "gmxpre.h"
 
 #include "gromacs/gpu_utils/gpueventsynchronizer.cuh"
-#include "gromacs/mdlib/leapfrog_cuda.cuh"
+#include "gromacs/mdlib/leapfrog_gpu.cuh"
 #include "gromacs/mdlib/lincs_cuda.cuh"
 #include "gromacs/mdlib/settle_cuda.cuh"
 #include "gromacs/mdlib/update_constrain_cuda.h"
@@ -197,7 +197,7 @@ private:
     int numInverseMassesAlloc_ = -1;
 
     //! Leap-Frog integrator
-    std::unique_ptr<LeapFrogCuda> integrator_;
+    std::unique_ptr<LeapFrogGpu> integrator_;
     //! LINCS CUDA object to use for non-water constraints
     std::unique_ptr<LincsCuda> lincsCuda_;
     //! SETTLE CUDA object for water constrains