+GpuEventSynchronizer* StatePropagatorDataGpu::Impl::getCoordinatesReadyOnDeviceEvent(AtomLocality atomLocality,
+ const SimulationWorkload &simulationWork,
+ const StepWorkload &stepWork)
+{
+ // The provider of the coordinates may be different for local atoms. If the update is offloaded
+ // and this is not a neighbor search step, then the consumer needs to wait for the update
+ // to complete. Otherwise, the coordinates are copied from the host and we need to wait for
+ // the copy event. Non-local coordinates are always provided by the H2D copy.
+ //
+ // TODO: This should be reconsidered to support the halo exchange.
+ //
+ if (atomLocality == AtomLocality::Local && simulationWork.useGpuUpdate && !stepWork.doNeighborSearch)
+ {
+ return &xUpdatedOnDevice_;
+ }
+ else
+ {
+ return &xReadyOnDevice_[atomLocality];
+ }
+}
+
+GpuEventSynchronizer* StatePropagatorDataGpu::Impl::xUpdatedOnDevice()