diff options
| author | Timothy G Rogers <[email protected]> | 2018-04-18 15:51:50 -0400 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2018-04-18 15:51:50 -0400 |
| commit | e97db22feb5aef9978feaae9f5c92507c73d7d96 (patch) | |
| tree | 12caa122df78e40310ca7f376263b7f21dc13fa4 /src/gpgpusim_entrypoint.cc | |
| parent | 12f2a2c791747dc38a53553026ed8122e8e08988 (diff) | |
| parent | b61a26eb163565cce292f7a2400b5fd82f3d2d10 (diff) | |
Merge branch 'dev-purdue-integration' into dev-purdue-integration
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
| -rw-r--r-- | src/gpgpusim_entrypoint.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index d94fd8a..a18e956 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) { @@ -167,10 +174,10 @@ 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); |
