diff options
| author | Andrew M. B. Boktor <[email protected]> | 2012-05-08 18:19:15 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:19:38 -0700 |
| commit | 319d541210cf1c5c00d11f8f9bb41dee7d7d8f76 (patch) | |
| tree | d524177ffe64642472a0c9e903ed0d90dc9c1296 /src/gpgpusim_entrypoint.cc | |
| parent | ac470a84b497769d6a16744e582c81e56f78d343 (diff) | |
A much easier way to attempt to fix the problem targeted by CL12362 is to just print the stats whenever a kernel is done.
This requires decoupling updating the stats from printing them and modifying the printing code to accomodate this change.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12366]
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
| -rw-r--r-- | src/gpgpusim_entrypoint.cc | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 74a644a..5c20056 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -107,27 +107,17 @@ void *gpgpu_sim_thread_concurrent(void*) bool active = false; bool sim_cycles = false; g_the_gpu->init(); - bool finished_kernel=false; do { // check if a kernel has completed unsigned grid_uid = g_the_gpu->finished_kernel(); if( grid_uid ){ g_stream_manager->register_finished_kernel(grid_uid); - finished_kernel=true; + g_the_gpu->print_stats(); } - - if(finished_kernel){ - if(!g_the_gpu->active()) break; //delay the break until all instructions drain - } - else{ - /* Only insert new operations if no kernels have finished since the start of this - loop - */ - // launch operation on device if one is pending and can be run - stream_operation op = g_stream_manager->front(); - op.do_operation(g_the_gpu); - } + // launch operation on device if one is pending and can be run + stream_operation op = g_stream_manager->front(); + op.do_operation(g_the_gpu); // simulate a clock cycle on the GPU if( g_the_gpu->active() ) { @@ -141,8 +131,9 @@ void *gpgpu_sim_thread_concurrent(void*) printf("GPGPU-Sim: ** STOP simulation thread (no work) **\n"); fflush(stdout); } - if( sim_cycles ) - g_the_gpu->print_stats(); + if(sim_cycles) { + g_the_gpu->update_stats(); + } pthread_mutex_lock(&g_sim_lock); g_sim_active = false; pthread_mutex_unlock(&g_sim_lock); |
