Remove unnecessary CUDA stream synchronization calls
authorArtem Zhmurov <zhmurov@gmail.com>
Sun, 20 Oct 2019 13:30:30 +0000 (15:30 +0200)
committerSzilárd Páll <pall.szilard@gmail.com>
Tue, 22 Oct 2019 23:09:22 +0000 (01:09 +0200)
These calls were needed before the synchronization was re-introduced.
With the event-based synchronization in place, they are no longer
necessary.

Change-Id: I9507432b40962cd49e4fc7374f15530c7fbf2ae7

src/gromacs/mdtypes/state_propagator_data_gpu_impl_gpu.cpp

index cca10920d1bebd0ff15905d5a1a904deee951af4..dacda5fed168aacda66535178772cf481d80699e 100644 (file)
@@ -349,8 +349,6 @@ void StatePropagatorDataGpu::Impl::copyCoordinatesFromGpu(gmx::ArrayRef<gmx::RVe
     GMX_ASSERT(commandStream != nullptr, "No stream is valid for copying positions with given atom locality.");
 
     copyFromDevice(h_x, d_x_, d_xSize_, atomLocality, commandStream);
-    // TODO: Remove When event-based synchronization is introduced
-    gpuStreamSynchronize(commandStream);
     // Note: unlike copyCoordinatesToGpu this is not used in OpenCL, and the conditional is not needed.
     xReadyOnHost_[atomLocality].markEvent(commandStream);
 }
@@ -374,8 +372,6 @@ void StatePropagatorDataGpu::Impl::copyVelocitiesToGpu(const gmx::ArrayRef<const
     GMX_ASSERT(commandStream != nullptr, "No stream is valid for copying velocities with given atom locality.");
 
     copyToDevice(d_v_, h_v, d_vSize_, atomLocality, commandStream);
-    // TODO: Remove When event-based synchronization is introduced
-    gpuStreamSynchronize(commandStream);
     vReadyOnDevice_[atomLocality].markEvent(commandStream);
 }
 
@@ -393,8 +389,6 @@ void StatePropagatorDataGpu::Impl::copyVelocitiesFromGpu(gmx::ArrayRef<gmx::RVec
     GMX_ASSERT(commandStream != nullptr, "No stream is valid for copying velocities with given atom locality.");
 
     copyFromDevice(h_v, d_v_, d_vSize_, atomLocality, commandStream);
-    // TODO: Remove When event-based synchronization is introduced
-    gpuStreamSynchronize(commandStream);
     vReadyOnHost_[atomLocality].markEvent(commandStream);
 }