From e34d1f98468d3d06da76c7c6b2b2fac7ef4703dd Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Thu, 7 Feb 2013 16:32:06 -0800 Subject: Adding in a statistic for number of dynamic warps issued by their ID. Also fixing some really scary code that was memsetting the "*this" to 0. The code sort of worked since there was only one member on the derived class (that was never referenced) and it had no virtual functions. What I did to fix this is equally ugly, but far less dangerous. I get a pointer to the start of the "plain old data (pod)" section of the class then memset it to 0. Now the derived stats class can have more stuff on it than pod and we don't have to worry about stomping. The "right" fix here is to not derive from pod and just make it a member with an accessor. However, this is going to require all the client code to be re-written. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15203] --- src/gpgpu-sim/shader.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gpgpu-sim/shader.cc') diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc index 1ede609..72a1936 100644 --- a/src/gpgpu-sim/shader.cc +++ b/src/gpgpu-sim/shader.cc @@ -426,6 +426,16 @@ void shader_core_stats::print( FILE* fout ) const fprintf(fout, "\n"); } +void shader_core_stats::event_warp_issued( unsigned s_id, unsigned warp_id, unsigned num_issued, unsigned dynamic_warp_id ) { + assert( warp_id <= m_config->max_warps_per_shader ); + for ( unsigned i = 0; i < num_issued; ++i ) { + if ( m_shader_dynamic_warp_issue_distro[ s_id ].size() <= dynamic_warp_id ) { + m_shader_dynamic_warp_issue_distro[ s_id ].resize(dynamic_warp_id + 1); + } + ++m_shader_dynamic_warp_issue_distro[ s_id ][ dynamic_warp_id ]; + } +} + void shader_core_stats::visualizer_print( gzFile visualizer_file ) { // warp divergence breakdown -- cgit v1.3