#include "config.h"
+#include <utility>
+
#include "gromacs/domdec/gpuhaloexchange.h"
#include "gromacs/utility/gmxassert.h"
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 */)
#include <assert.h>
#include <stdio.h>
+#include <utility>
+
#include "gromacs/domdec/domdec.h"
#include "gromacs/domdec/domdec_struct.h"
#include "gromacs/domdec/gpuhaloexchange.h"
{
}
+GpuHaloExchange::GpuHaloExchange(GpuHaloExchange&&) noexcept = default;
+
+GpuHaloExchange& GpuHaloExchange::operator=(GpuHaloExchange&& other) noexcept
+{
+ std::swap(impl_, other.impl_);
+ return *this;
+}
+
GpuHaloExchange::~GpuHaloExchange() = default;
void GpuHaloExchange::reinitHalo(DeviceBuffer<RVec> d_coordinatesBuffer, DeviceBuffer<RVec> d_forcesBuffer)
#include "config.h"
#include <array>
+#include <vector>
#include <gtest/gtest.h>
GpuEventSynchronizer coordinatesReadyOnDeviceEvent;
coordinatesReadyOnDeviceEvent.markEvent(deviceStream);
- std::vector<std::unique_ptr<gmx::GpuHaloExchange>> gpuHaloExchange[DIM];
+ std::array<std::vector<GpuHaloExchange>, DIM> gpuHaloExchange;
// Create halo exchange objects
for (int d = 0; d < dd->ndim; d++)
{
for (int pulse = 0; pulse < dd->comm->cd[d].numPulses(); pulse++)
{
- gpuHaloExchange[d].push_back(std::make_unique<GpuHaloExchange>(
- dd, d, MPI_COMM_WORLD, deviceContext, deviceStream, deviceStream, pulse, nullptr));
+ gpuHaloExchange[d].push_back(GpuHaloExchange(dd, d, MPI_COMM_WORLD, deviceContext,
+ deviceStream, deviceStream, pulse, nullptr));
}
}
{
for (int pulse = 0; pulse < dd->comm->cd[d].numPulses(); pulse++)
{
- gpuHaloExchange[d][pulse]->reinitHalo(d_x, nullptr);
- gpuHaloExchange[d][pulse]->communicateHaloCoordinates(box, &coordinatesReadyOnDeviceEvent);
+ gpuHaloExchange[d][pulse].reinitHalo(d_x, nullptr);
+ gpuHaloExchange[d][pulse].communicateHaloCoordinates(box, &coordinatesReadyOnDeviceEvent);
}
}