diff options
| author | Tor Aamodt <[email protected]> | 2018-04-11 14:33:53 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-04-11 14:33:53 -0700 |
| commit | cdb59de6dc329ce5777e3c961c09d26f37d32fec (patch) | |
| tree | d5107199f935391aead8e2415db8931c9fe91805 /src/gpgpusim_entrypoint.cc | |
| parent | 2221d208a745a098a60b0d24c05007e92aaba092 (diff) | |
| parent | 89094df5b4e861b104393ea0f41886494a7f26a4 (diff) | |
Merge pull request #65 from tgrogers/dev
Bunch of changes made to 3.x that help with data collection
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
| -rw-r--r-- | src/gpgpusim_entrypoint.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index ad4587a..ede9f20 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -93,8 +93,15 @@ bool g_sim_active = false; bool g_sim_done = true; bool break_limit = false; +static void termination_callback() +{ + printf("GPGPU-Sim: *** exit detected ***\n"); + fflush(stdout); +} + void *gpgpu_sim_thread_concurrent(void*) { + atexit(termination_callback); // concurrent kernel execution simulation thread do { if(g_debug_execution >= 3) { @@ -156,8 +163,8 @@ void *gpgpu_sim_thread_concurrent(void*) printf("GPGPU-Sim: ** STOP simulation thread (no work) **\n"); fflush(stdout); } - g_the_gpu->print_stats(); if(sim_cycles) { + g_the_gpu->print_stats(); g_the_gpu->update_stats(); print_simulation_time(); } @@ -165,10 +172,9 @@ void *gpgpu_sim_thread_concurrent(void*) g_sim_active = false; pthread_mutex_unlock(&g_sim_lock); } while( !g_sim_done ); - if(g_debug_execution >= 3) { - printf("GPGPU-Sim: *** simulation thread exiting ***\n"); - fflush(stdout); - } + printf("GPGPU-Sim: *** simulation thread exiting ***\n"); + fflush(stdout); + if(break_limit) { printf("GPGPU-Sim: ** break due to reaching the maximum cycles (or instructions) **\n"); exit(1); |
