summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-sim.cc
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-02-13 10:36:29 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:19:02 -0700
commit95215f59825ff9def72c3bb237c58bb02c8c2411 (patch)
treeef008e44eff86a36e5a95ae44f09d9845e280522 /src/gpgpu-sim/gpu-sim.cc
parentf0bfd72df3f664c2b44595d1a393ec6b535181c0 (diff)
Fixed the stat collection for gpgpu_n_shmem_insn. See Bug 128 for more detail. For verification, I added a directed test with a pre-calculated number of shared memory instructions.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 11454]
Diffstat (limited to 'src/gpgpu-sim/gpu-sim.cc')
-rw-r--r--src/gpgpu-sim/gpu-sim.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 6b448ab..3200c9c 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -639,30 +639,31 @@ unsigned gpgpu_sim::threads_per_core() const
void shader_core_ctx::mem_instruction_stats(const warp_inst_t &inst)
{
+ unsigned active_count = inst.active_count();
//this breaks some encapsulation: the is_[space] functions, if you change those, change this.
switch (inst.space.get_type()) {
case undefined_space:
case reg_space:
break;
case shared_space:
- m_stats->gpgpu_n_shmem_insn++;
+ m_stats->gpgpu_n_shmem_insn += active_count;
break;
case const_space:
- m_stats->gpgpu_n_const_insn++;
+ m_stats->gpgpu_n_const_insn += active_count;
break;
case param_space_kernel:
case param_space_local:
- m_stats->gpgpu_n_param_insn++;
+ m_stats->gpgpu_n_param_insn += active_count;
break;
case tex_space:
- m_stats->gpgpu_n_tex_insn++;
+ m_stats->gpgpu_n_tex_insn += active_count;
break;
case global_space:
case local_space:
if( inst.is_store() )
- m_stats->gpgpu_n_store_insn++;
+ m_stats->gpgpu_n_store_insn += active_count;
else
- m_stats->gpgpu_n_load_insn++;
+ m_stats->gpgpu_n_load_insn += active_count;
break;
default:
abort();