From 39f1153c4bcb900cb9c096aa40584ccb6f38fa8d Mon Sep 17 00:00:00 2001
From: Toni Portero <a.portero@fz-juelich.de>
Date: Sat, 25 Apr 2020 19:35:13 +0200
Subject: [PATCH] Added M5 for gem5

---
 openmp/src/main.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/openmp/src/main.cpp b/openmp/src/main.cpp
index 5a38b7f..1a5fe14 100644
--- a/openmp/src/main.cpp
+++ b/openmp/src/main.cpp
@@ -62,6 +62,10 @@
 #include <miniFE_no_info.hpp>
 #endif
 
+#ifdef USEM5OPS     
+#include <gem5/m5ops.h> 
+#endif
+
 //The following macros should be specified as compile-macros in the
 //makefile. They are defaulted here just in case...
 #ifndef MINIFE_SCALAR
@@ -95,7 +99,9 @@ int main(int argc, char** argv) {
   miniFE::initialize_mpi(argc, argv, numprocs, myproc);
 
   miniFE::timer_type start_time = miniFE::mytimer();
-
+  #ifdef USEM5OPS              
+  m5_reset_stats(0,0);     
+  #endif
 #ifdef MINIFE_DEBUG
   outstream(numprocs, myproc);
 #endif
@@ -177,6 +183,10 @@ int main(int argc, char** argv) {
   int return_code =
      miniFE::driver< MINIFE_SCALAR, MINIFE_LOCAL_ORDINAL, MINIFE_GLOBAL_ORDINAL>(global_box, my_box, params, doc);
 
+  #ifdef USEM5OPS              
+  m5_dump_stats(0,0);     
+  #endif
+
   miniFE::timer_type total_time = miniFE::mytimer() - start_time;
 
 #ifdef MINIFE_REPORT_RUSAGE
-- 
GitLab