Skip to content

Commit 94a278b

Browse files
authored
refactor(dd4hep): remove redundant cudaDeviceSynchronize in OpticsEvent (#335)
`OpticsEvent::end` calls `cudaDeviceSynchronize()` immediately after G4CXOpticks::simulate(), but simulate() already drains the device internally, CSGOptiX::simulate_launch follows every optixLaunch with `CUDA_SYNC_CHECK()` . Tested, works.
1 parent be460aa commit 94a278b

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

dd4hepplugins/OpticsEvent.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <G4Event.hh>
1111

1212
#include <chrono>
13-
#include <cuda_runtime.h>
1413

1514
#include <G4CXOpticks.hh>
1615
#include <NP.hh>
@@ -94,7 +93,6 @@ void OpticsEvent::end(G4Event const *event)
9493
{
9594
auto sim_t0 = std::chrono::high_resolution_clock::now();
9695
gx->simulate(eventID, /*reset=*/false);
97-
cudaDeviceSynchronize();
9896
auto sim_t1 = std::chrono::high_resolution_clock::now();
9997
double simulate_ms = std::chrono::duration<double, std::milli>(sim_t1 - sim_t0).count();
10098

0 commit comments

Comments
 (0)