summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim
diff options
context:
space:
mode:
authorAhmed El-Shafiey <[email protected]>2012-11-30 23:07:40 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:22 -0700
commita4e786e7ba32deb2877722650a907ccdb1bef096 (patch)
treead16af8eb995fcd05b3eda579284e192ea9cb6a3 /src/gpgpu-sim
parentaab87f149f7442d1447cbb82cc6290d185a56aa5 (diff)
fixing a segfault problem for Quadro config with interconnect stats
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14737]
Diffstat (limited to 'src/gpgpu-sim')
-rw-r--r--src/gpgpu-sim/gpu-sim.cc2
-rw-r--r--src/gpgpu-sim/gpu-sim.h1
-rw-r--r--src/gpgpu-sim/shader.cc13
3 files changed, 11 insertions, 5 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index b2b00a4..9d3145b 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -759,7 +759,7 @@ void gpgpu_sim::gpu_print_stat()
m_memory_partition_unit[i]->set_icnt_power_stats(temp);
total_mem_to_simt += temp;
}
- for(unsigned i=0; i<m_config.num_shader(); i++){
+ for(unsigned i=0; i<m_config.num_cluster(); i++){
unsigned temp=0;
m_cluster[i]->set_icnt_stats(temp);
total_simt_to_mem += temp;
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index 7866688..98f719f 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -302,6 +302,7 @@ public:
}
unsigned num_shader() const { return m_shader_config.num_shader(); }
+ unsigned num_cluster() const { return m_shader_config.n_simt_clusters; }
unsigned get_max_concurrent_kernel() const { return max_concurrent_kernel; }
private:
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 4095cbc..ad097e8 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -971,10 +971,15 @@ void ldst_unit::set_icnt_power_stats(unsigned &simt_to_mem) const{
unsigned tex=0;
unsigned l1c=0;
- m_L1D->set_icnt_power_stats(l1d);
- m_L1T->set_icnt_power_stats(tex);
- m_L1C->set_icnt_power_stats(l1c);
-
+ if( m_L1D ) {
+ m_L1D->set_icnt_power_stats(l1d);
+ }
+ if( m_L1T ){
+ m_L1T->set_icnt_power_stats(tex);
+ }
+ if( m_L1C ){
+ m_L1C->set_icnt_power_stats(l1c);
+ }
simt_to_mem = n_simt_to_mem+l1d+tex+l1c; // All components that push packets into the interconnect
}