From e0b7bffebe7b3ee707a7c4ef330f57dfe280d667 Mon Sep 17 00:00:00 2001 From: Pranav Sivaraman <14294205+pranav-sivaraman@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:09:56 -0400 Subject: [PATCH] fix: adjust timer start and end --- kokkos/Simulation.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kokkos/Simulation.cpp b/kokkos/Simulation.cpp index 6ac060a..45e09c4 100644 --- a/kokkos/Simulation.cpp +++ b/kokkos/Simulation.cpp @@ -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); @@ -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(0, in.lookups), KOKKOS_LAMBDA (int i) { @@ -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; }