summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-sim.h
diff options
context:
space:
mode:
authorJRPan <[email protected]>2024-08-20 20:43:32 -0400
committerGitHub <[email protected]>2024-08-21 00:43:32 +0000
commit38b4df5653ecbd9907a3d39b125640cd4fb7d012 (patch)
tree4f6e55736c1b6b33c4b43a668f79d7a84e665b29 /src/gpgpu-sim/gpu-sim.h
parent42a0cde4b463794d041b544309afb69c315f78bc (diff)
Stream stats (#71)
* Temp commit for Justin and Cassie to sync on code changes for adding per-stream status. * Resolved compile errors. * Removed redundant parameter * Passed cuda_stream_id from accelsim to gpgpusim * Cleaned up unused changes * Changed vector to map, having operator problems. * StreamID defaults to zero * Implemented streams to inc_stats and so on * Fixed TOTAL_ACCESS counts * Implemented GLOBAL_TIMER. * Fixed m_shader->get_kernel SEGFAULT issue in shader.cc. * Use warp_init to track streamID instead of issue_warp * Removed temp debug print * Modified cache_stats to only print data from latest finished stream Added optional arg to cache_stats::print_stats, cache_stats::print_fail_stats and their upstream functions. When streamID is specified, print stats from that stream. When not specified, print all stats. NOTE: current implementation depending on streamid never equals -1 * Removed default arg values of streamID * modified constructor of mem_fetch to pass in streamID * changed get_streamid to get_streamID * Added TODO to gpgpusim_entrypoint.cc and power_stat.cc * Only collect power stats when enabled * print last finished stream in PTX mode using last_streamID * take out additional printf * Add a field to baseline cache to indicate cache level * save gpu object in cache * Print stream ID only once per kernel * rm test print * use -1 for default stream id * cleanup debug prints * remove GLOABL_TIMER * Automated clang-format * Should be correct to print everything in power model * addressing concerns & errors * Automated clang-format * add m_stats_pw in operator+ * Automated Format --------- Co-authored-by: Justin Qiao <[email protected]> Co-authored-by: Justin Qiao <[email protected]> Co-authored-by: Tim Rogers <[email protected]> Co-authored-by: JRPan <[email protected]> Co-authored-by: purdue-jenkins <[email protected]>
Diffstat (limited to 'src/gpgpu-sim/gpu-sim.h')
-rw-r--r--src/gpgpu-sim/gpu-sim.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index d43b399..8e81451 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -539,7 +539,7 @@ class gpgpu_sim : public gpgpu_t {
(m_config.gpu_max_completed_cta_opt &&
(gpu_completed_cta >= m_config.gpu_max_completed_cta_opt));
}
- void print_stats();
+ void print_stats(unsigned long long streamID);
void update_stats();
void deadlock_check();
void inc_completed_cta() { gpu_completed_cta++; }
@@ -568,7 +568,7 @@ class gpgpu_sim : public gpgpu_t {
void decrement_kernel_latency();
const gpgpu_sim_config &get_config() const { return m_config; }
- void gpu_print_stat();
+ void gpu_print_stat(unsigned long long streamID);
void dump_pipeline(int mask, int s, int m) const;
void perf_memcpy_to_gpu(size_t dst_start_addr, size_t count);
@@ -685,6 +685,17 @@ class gpgpu_sim : public gpgpu_t {
occupancy_stats gpu_occupancy;
occupancy_stats gpu_tot_occupancy;
+ typedef struct {
+ unsigned long long start_cycle;
+ unsigned long long end_cycle;
+ } kernel_time_t;
+ std::map<unsigned long long, std::map<unsigned, kernel_time_t>>
+ gpu_kernel_time;
+ unsigned long long last_streamID;
+ unsigned long long last_uid;
+ cache_stats aggregated_l1_stats;
+ cache_stats aggregated_l2_stats;
+
// performance counter for stalls due to congestion.
unsigned int gpu_stall_dramfull;
unsigned int gpu_stall_icnt2sh;
@@ -712,6 +723,9 @@ class gpgpu_sim : public gpgpu_t {
public:
bool is_functional_sim() { return m_functional_sim; }
kernel_info_t *get_functional_kernel() { return m_functional_sim_kernel; }
+ std::vector<kernel_info_t *> get_running_kernels() {
+ return m_running_kernels;
+ }
void functional_launch(kernel_info_t *k) {
m_functional_sim = true;
m_functional_sim_kernel = k;