diff options
| author | Wilson Fung <[email protected]> | 2012-08-30 03:08:52 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:48:54 -0700 |
| commit | 66a788b7463bb92595977c7540afa8a2adba2726 (patch) | |
| tree | ce1bcd41bcfcae274f9ff28fb30fc95b03829521 /src | |
| parent | fc37c72f0681d142371ff4f5fff5cd972faf51a9 (diff) | |
Fixed incorrect counting of predicated instruction. (Bug #15 external)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13918]
Diffstat (limited to 'src')
| -rw-r--r-- | src/abstract_hardware_model.h | 7 | ||||
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index fda4763..766dff1 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -689,7 +689,8 @@ public: } void issue( const active_mask_t &mask, unsigned warp_id, unsigned long long cycle ) { - m_warp_active_mask=mask; + m_warp_active_mask = mask; + m_warp_issued_mask = mask; m_uid = ++sm_next_uid; m_warp_id = warp_id; issue_cycle = cycle; @@ -763,6 +764,7 @@ public: } bool active( unsigned thread ) const { return m_warp_active_mask.test(thread); } unsigned active_count() const { return m_warp_active_mask.count(); } + unsigned issued_count() const { assert(m_empty == false); return m_warp_issued_mask.count(); } // for instruction counting bool empty() const { return m_empty; } unsigned warp_id() const { @@ -810,7 +812,8 @@ protected: bool m_is_printf; unsigned m_warp_id; const core_config *m_config; - active_mask_t m_warp_active_mask; + active_mask_t m_warp_active_mask; // dynamic active mask for timing model (after predication) + active_mask_t m_warp_issued_mask; // active mask at issue (prior to predication test) -- for instruction counting struct per_thread_info { per_thread_info() { diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index ddb544a..b3e5fc5 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -872,9 +872,9 @@ void shader_core_ctx::warp_inst_complete(const warp_inst_t &inst) printf("[warp_inst_complete] uid=%u core=%u warp=%u pc=%#x @ time=%llu issued@%llu\n", inst.get_uid(), m_sid, inst.warp_id(), inst.pc, gpu_tot_sim_cycle + gpu_sim_cycle, inst.get_issue_cycle()); #endif - m_stats->m_num_sim_insn[m_sid] += inst.active_count(); + m_stats->m_num_sim_insn[m_sid] += inst.issued_count(); m_stats->m_num_sim_winsn[m_sid]++; - m_gpu->gpu_sim_insn += inst.active_count(); + m_gpu->gpu_sim_insn += inst.issued_count(); inst.completed(gpu_tot_sim_cycle + gpu_sim_cycle); } |
