Skip to content

Commit

Permalink
fix: adjust timer start and end
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-sivaraman committed Oct 19, 2023
1 parent 87c10de commit e0b7bff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kokkos/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ unsigned long long run_event_based_simulation(Inputs in, SimulationData SD, int
// Data movment and setup
int length_max_num_nucs = 1;

Kokkos::Timer start;
start.reset();

UIntView u_max_num_nucs(&SD.max_num_nucs, 1);
SD.d_max_num_nucs = new IntView("d_max_num_nucs", length_max_num_nucs);
Kokkos::deep_copy(*SD.d_max_num_nucs, u_max_num_nucs);
Expand Down Expand Up @@ -87,6 +84,9 @@ unsigned long long run_event_based_simulation(Inputs in, SimulationData SD, int
Kokkos::create_mirror_view(d_verification);
Kokkos::deep_copy(d_verification, verification);

Kokkos::Timer start;
start.reset();

Kokkos::parallel_for("Simulation",
Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(0, in.lookups),
KOKKOS_LAMBDA (int i) {
Expand Down Expand Up @@ -148,13 +148,14 @@ unsigned long long run_event_based_simulation(Inputs in, SimulationData SD, int
Kokkos::fence();

// End Simulation Timer
*end = start.seconds();

// Reduce validation hash on the host
unsigned long long validation_hash = 0;
for( int i = 0; i < in.lookups; i++ )
validation_hash += verification(i);

*end = start.seconds();

return validation_hash;
}

Expand Down

0 comments on commit e0b7bff

Please sign in to comment.