/* Note that with a GPU the launch overhead of the list transfer is not timed separately */
nbv->constructPairlist(InteractionLocality::Local, top->excls, step, nrnb);
- nbv->setupGpuShortRangeWork(fr->listedForcesGpu, InteractionLocality::Local);
+ nbv->setupGpuShortRangeWork(fr->listedForcesGpu.get(), InteractionLocality::Local);
wallcycle_sub_stop(wcycle, WallCycleSubCounter::NBSSearchLocal);
wallcycle_stop(wcycle, WallCycleCounter::NS);
/* Note that with a GPU the launch overhead of the list transfer is not timed separately */
nbv->constructPairlist(InteractionLocality::NonLocal, top->excls, step, nrnb);
- nbv->setupGpuShortRangeWork(fr->listedForcesGpu, InteractionLocality::NonLocal);
+ nbv->setupGpuShortRangeWork(fr->listedForcesGpu.get(), InteractionLocality::NonLocal);
wallcycle_sub_stop(wcycle, WallCycleSubCounter::NBSSearchNonLocal);
wallcycle_stop(wcycle, WallCycleCounter::NS);
// TODO refactor this GPU halo exchange re-initialisation
}
}
- launchGpuEndOfStepTasks(nbv, fr->listedForcesGpu, fr->pmedata, enerd, *runScheduleWork, step, wcycle);
+ launchGpuEndOfStepTasks(
+ nbv, fr->listedForcesGpu.get(), fr->pmedata, enerd, *runScheduleWork, step, wcycle);
if (DOMAINDECOMP(cr))
{
const bool thisRankHasPmeGpuTask = gpuTaskAssignments.thisRankHasPmeGpuTask();
std::unique_ptr<MDAtoms> mdAtoms;
std::unique_ptr<VirtualSitesHandler> vsite;
- std::unique_ptr<ListedForcesGpu> listedForcesGpu;
t_nrnb nrnb;
if (thisRankHasDuty(cr, DUTY_PP))
GMX_RELEASE_ASSERT(deviceStreamManager != nullptr,
"GPU device stream manager should be valid in order to use GPU "
"version of bonded forces.");
- listedForcesGpu = std::make_unique<ListedForcesGpu>(
+ fr->listedForcesGpu = std::make_unique<ListedForcesGpu>(
mtop.ffparams,
fr->ic->epsfac * fr->fudgeQQ,
deviceStreamManager->context(),
deviceStreamManager->bondedStream(havePPDomainDecomposition(cr)),
wcycle.get());
- fr->listedForcesGpu = listedForcesGpu.get();
}
/* Initialize the mdAtoms structure.
mdAtoms.reset(nullptr);
globalState.reset(nullptr);
mdModules_.reset(nullptr); // destruct force providers here as they might also use the GPU
- listedForcesGpu.reset(nullptr);
- fr.reset(nullptr); // destruct forcerec before gpu
+ fr.reset(nullptr); // destruct forcerec before gpu
// TODO convert to C++ so we can get rid of these frees
sfree(disresdata);
// The listed forces calculation data, 1 entry or multiple entries with multiple time stepping
std::vector<ListedForces> listedForces;
- /* TODO: Replace the pointer by an object once we got rid of C */
- gmx::ListedForcesGpu* listedForcesGpu = nullptr;
+ // The listed forces calculation data for GPU
+ std::unique_ptr<gmx::ListedForcesGpu> listedForcesGpu;
/* Ewald correction thread local virial and energy data */
int nthread_ewc = 0;