diff options
| author | Tim Rogers <[email protected]> | 2013-02-07 16:32:06 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:49:25 -0700 |
| commit | e34d1f98468d3d06da76c7c6b2b2fac7ef4703dd (patch) | |
| tree | 65a6cdb9a9dd3a486bd46058be76a5bd37a53c02 /src/gpgpu-sim/shader.cc | |
| parent | cfed96a0d4f20ea8132d60e028893fed130220a5 (diff) | |
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]
Diffstat (limited to 'src/gpgpu-sim/shader.cc')
| -rw-r--r-- | src/gpgpu-sim/shader.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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 |
