From a862a16b2d8e77fc5279adc02578e4ad35422f38 Mon Sep 17 00:00:00 2001 From: Tayler Hetherington Date: Tue, 18 Jun 2013 11:50:29 -0800 Subject: Review: 47001. Fixing bug in CL16463. When streams are actually used, kernels can complete while other kernels are still running. The fix in CL16463 caused the GPU to re-initialize when a kernel completes, which may occur while another kernel is still running. Added a check to test if the GPU is also inactive when a kernel completes in order to re-initialize. simpleStreams CUDA SDK now passes with CUDA 3.1. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16469] --- src/gpgpusim_entrypoint.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 20fb88e..28f909b 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -122,8 +122,9 @@ void *gpgpu_sim_thread_concurrent(void*) // If another stream operation is available, g_the_gpu remains active, // causing this loop to not break. If the next operation happens to be // another kernel, the gpu is not re-initialized and the inter-kernel - // behaviour may be incorrect. - if(g_stream_manager->operation(&sim_cycles)) + // behaviour may be incorrect. Check that a kernel has finished and + // no other kernel is currently running. + if(g_stream_manager->operation(&sim_cycles) && !g_the_gpu->active()) break; if( g_the_gpu->active() ) { -- cgit v1.3