diff options
| author | Mengchi Zhang <[email protected]> | 2019-07-15 13:31:36 -0400 |
|---|---|---|
| committer | Mengchi Zhang <[email protected]> | 2019-07-15 13:31:36 -0400 |
| commit | 36aaec0a30445533f04aaf6b55c5ef135e20484a (patch) | |
| tree | aa47ed8140bc6d7388bd6afeab59b33705744b3b /src/cuda-sim | |
| parent | bd170826a00fe1ea1960ff2e23247ed3f980547b (diff) | |
Move ptx_line_stats_filename and enable_ptx_file_line_stats
Signed-off-by: Mengchi Zhang <[email protected]>
Diffstat (limited to 'src/cuda-sim')
| -rw-r--r-- | src/cuda-sim/ptx-stats.cc | 9 | ||||
| -rw-r--r-- | src/cuda-sim/ptx-stats.h | 23 |
2 files changed, 19 insertions, 13 deletions
diff --git a/src/cuda-sim/ptx-stats.cc b/src/cuda-sim/ptx-stats.cc index 0a9f08d..298729f 100644 --- a/src/cuda-sim/ptx-stats.cc +++ b/src/cuda-sim/ptx-stats.cc @@ -32,12 +32,9 @@ #include <stdio.h> #include <map> #include "../tr1_hash_map.h" +#include "../../libcuda/gpgpu_context.h" -// options -bool enable_ptx_file_line_stats; -char * ptx_line_stats_filename = NULL; - -void ptx_file_line_stats_options(option_parser_t opp) +void ptx_stats::ptx_file_line_stats_options(option_parser_t opp) { option_parser_register(opp, "-enable_ptx_file_line_stats", OPT_BOOL, &enable_ptx_file_line_stats, @@ -118,7 +115,7 @@ typedef tr1_hash_map<ptx_file_line, ptx_file_line_stats, hash_ptx_file_line> ptx static ptx_file_line_stats_map_t ptx_file_line_stats_tracker; // output statistics to a file -void ptx_file_line_stats_write_file() +void ptx_stats::ptx_file_line_stats_write_file() { // check if stat collection is turned on if (enable_ptx_file_line_stats == 0) return; diff --git a/src/cuda-sim/ptx-stats.h b/src/cuda-sim/ptx-stats.h index 4fc6599..c75fc58 100644 --- a/src/cuda-sim/ptx-stats.h +++ b/src/cuda-sim/ptx-stats.h @@ -29,13 +29,6 @@ #include "../option_parser.h" -extern bool enable_ptx_file_line_stats; - -// set options -void ptx_file_line_stats_options(option_parser_t opp); - -// output stats to a file -void ptx_file_line_stats_write_file(); #ifdef __cplusplus // stat collection interface to cuda-sim @@ -56,3 +49,19 @@ void ptx_file_line_stats_commit_exposed_latency(int sc_id, int exposed_latency); void ptx_file_line_stats_add_warp_divergence(unsigned pc, unsigned n_way_divergence); +class gpgpu_context; +class ptx_stats { + public: + ptx_stats(gpgpu_context* ctx) { + ptx_line_stats_filename = NULL; + gpgpu_ctx = ctx; + } + char * ptx_line_stats_filename; + bool enable_ptx_file_line_stats; + gpgpu_context* gpgpu_ctx; + // set options + void ptx_file_line_stats_options(option_parser_t opp); + + // output stats to a file + void ptx_file_line_stats_write_file(); +}; |
