summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2011-01-20 18:59:45 -0800
committerWilson Fung <[email protected]>2011-01-20 18:59:45 -0800
commit34149bec142ba633f1e1b26a528ef6d77a05a3f6 (patch)
tree57d6126ef2f1b294dcba69e8607531748ed7a371 /src/gpgpu-sim
parentf18e4327b836ac66843a1c21cb429cc71bea9714 (diff)
Integration change. Bug fixes from AMD-CMU trace gen branch.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 8389]
Diffstat (limited to 'src/gpgpu-sim')
-rw-r--r--src/gpgpu-sim/gpu-sim.cc1
-rw-r--r--src/gpgpu-sim/shader.cc6
-rw-r--r--src/gpgpu-sim/shader.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 05a9b55..1526ef3 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -711,6 +711,7 @@ void shader_core_ctx::issue_block2core( kernel_info_t &kernel )
m_thread[i].m_cta_id = free_cta_hw_id;
unsigned warp_id = i/m_config->warp_size;
nthreads_in_block += ptx_sim_init_thread(kernel,&m_thread[i].m_functional_model_thread_state,m_sid,i,cta_size-(i-start_thread),m_config->n_thread_per_shader,this,free_cta_hw_id,warp_id,m_cluster->get_gpu());
+ m_thread[i].m_active = true;
warps.set( warp_id );
}
assert( nthreads_in_block > 0 && nthreads_in_block <= m_config->n_thread_per_shader); // should be at least one, but less than max
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 2380bcf..2233566 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -135,6 +135,7 @@ shader_core_ctx::shader_core_ctx( class gpgpu_sim *gpu,
for (unsigned i = 0; i<config->n_thread_per_shader; i++) {
m_thread[i].m_functional_model_thread_state = NULL;
m_thread[i].m_cta_id = -1;
+ m_thread[i].m_active = false;
}
m_icnt = new shader_memory_interface(this,cluster);
@@ -519,12 +520,13 @@ void shader_core_ctx::fetch()
bool did_exit=false;
for( unsigned t=0; t<m_config->warp_size;t++) {
unsigned tid=warp_id*m_config->warp_size+t;
- if( m_thread[tid].m_functional_model_thread_state ) {
+ if( m_thread[tid].m_active == true ) {
+ m_thread[tid].m_active = false;
unsigned cta_id = m_warp[warp_id].get_cta_id();
register_cta_thread_exit(cta_id);
m_not_completed -= 1;
m_active_threads.reset(tid);
- m_thread[tid].m_functional_model_thread_state=NULL;
+ assert( m_thread[tid].m_functional_model_thread_state != NULL );
did_exit=true;
}
}
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 2b834a6..ee0269f 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -120,6 +120,8 @@ public:
unsigned n_l1_mis_ac;
unsigned n_l1_mrghit_ac;
unsigned n_l1_access_ac;
+
+ bool m_active;
};
class shd_warp_t {