From 95215f59825ff9def72c3bb237c58bb02c8c2411 Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Mon, 13 Feb 2012 10:36:29 -0800 Subject: 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] --- src/gpgpu-sim/gpu-sim.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gpgpu-sim/gpu-sim.cc') 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(); -- cgit v1.3