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.h | |
| 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.h')
| -rw-r--r-- | src/gpgpu-sim/shader.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h index c5a2ab2..5699115 100644 --- a/src/gpgpu-sim/shader.h +++ b/src/gpgpu-sim/shader.h @@ -210,6 +210,7 @@ public: unsigned get_cta_id() const { return m_cta_id; } unsigned get_dynamic_warp_id() const { return m_dynamic_warp_id; } + unsigned get_warp_id() const { return m_warp_id; } private: static const unsigned IBUFFER_SIZE=2; @@ -1147,6 +1148,7 @@ struct shader_core_config : public core_config struct shader_core_stats_pod { + void* shader_core_stats_pod_start[]; // DO NOT MOVE FROM THE TOP - spaceless pointer to the start of this structure unsigned long long *shader_cycles; unsigned *m_num_sim_insn; // number of scalar thread instructions committed by this shader core unsigned *m_num_sim_winsn; // number of warp instructions committed by this shader core @@ -1236,7 +1238,7 @@ public: shader_core_stats( const shader_core_config *config ) { m_config = config; - shader_core_stats_pod *pod = this; + shader_core_stats_pod *pod = reinterpret_cast< shader_core_stats_pod * > ( this->shader_core_stats_pod_start ); memset(pod,0,sizeof(shader_core_stats_pod)); shader_cycles=(unsigned long long *) calloc(config->num_shader(),sizeof(unsigned long long )); m_num_sim_insn = (unsigned*) calloc(config->num_shader(),sizeof(unsigned)); @@ -1292,17 +1294,24 @@ public: gpgpu_n_shmem_bank_access = (unsigned *)calloc(config->num_shader(), sizeof(unsigned)); + m_shader_dynamic_warp_issue_distro.resize( config->num_shader() ); + } + void new_grid() { } + void event_warp_issued( unsigned s_id, unsigned warp_id, unsigned num_issued, unsigned dynamic_warp_id ); + void visualizer_print( gzFile visualizer_file ); void print( FILE *fout ) const; private: const shader_core_config *m_config; + // Counts the instructions issued for each dynamic warp. + std::vector< std::vector<unsigned> > m_shader_dynamic_warp_issue_distro; friend class power_stat_t; friend class shader_core_ctx; |
