summaryrefslogtreecommitdiff
path: root/src/gpgpusim_entrypoint.cc
diff options
context:
space:
mode:
authorAndrew M. B. Boktor <[email protected]>2012-05-08 11:46:07 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:19:38 -0700
commit3bc5f3b298f929eda7407bf233ad7e4846e57776 (patch)
treee3e73263b9dc8adf05cc0d6d7b16faa800d1553a /src/gpgpusim_entrypoint.cc
parent8da76f1df562b168b6bb479b9254f3ca5b5c686c (diff)
Fixes a rare race condition that prevents the kernel stats from being printed.
Merging //depot/gpgpu_sim_research/fermi_replay/distribution/src/gpgpusim_entrypoint.cc to //depot/gpgpu_sim_research/fermi/distribution/src/gpgpusim_entrypoint.cc [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12356]
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
-rw-r--r--src/gpgpusim_entrypoint.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc
index 76c63b5..3e7f813 100644
--- a/src/gpgpusim_entrypoint.cc
+++ b/src/gpgpusim_entrypoint.cc
@@ -110,8 +110,10 @@ void *gpgpu_sim_thread_concurrent(void*)
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);
+ if( grid_uid ){
+ g_stream_manager->register_finished_kernel(grid_uid); //this requires recursive mutexes but doesnt appear to have them :( but works anyway?
+ break; //force stats print and update
+ }
// launch operation on device if one is pending and can be run
stream_operation op = g_stream_manager->front();