Add move operations to GpuHaloExchange
[alexxy/gromacs.git] / src / gromacs / domdec / gpuhaloexchange_impl.cpp
index 64221f0257deece465f0dc2f831f14e9c8b696e7..e00d4e3d606f96385ddc1b88a46f1fa2f588765e 100644 (file)
@@ -47,6 +47,8 @@
 
 #include "config.h"
 
+#include <utility>
+
 #include "gromacs/domdec/gpuhaloexchange.h"
 #include "gromacs/utility/gmxassert.h"
 
@@ -77,6 +79,14 @@ GpuHaloExchange::GpuHaloExchange(gmx_domdec_t* /* dd */,
 
 GpuHaloExchange::~GpuHaloExchange() = default;
 
+GpuHaloExchange::GpuHaloExchange(GpuHaloExchange&&) noexcept = default;
+
+GpuHaloExchange& GpuHaloExchange::operator=(GpuHaloExchange&& other) noexcept
+{
+    std::swap(impl_, other.impl_);
+    return *this;
+}
+
 /*!\brief init halo exhange stub. */
 void GpuHaloExchange::reinitHalo(DeviceBuffer<RVec> /* d_coordinatesBuffer */,
                                  DeviceBuffer<RVec> /* d_forcesBuffer */)