diff options
| author | JRPan <[email protected]> | 2024-08-20 20:43:32 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-21 00:43:32 +0000 |
| commit | 38b4df5653ecbd9907a3d39b125640cd4fb7d012 (patch) | |
| tree | 4f6e55736c1b6b33c4b43a668f79d7a84e665b29 /src/abstract_hardware_model.h | |
| parent | 42a0cde4b463794d041b544309afb69c315f78bc (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/abstract_hardware_model.h')
| -rw-r--r-- | src/abstract_hardware_model.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index e5f3b78..98a4039 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -233,7 +233,8 @@ class kernel_info_t { // m_num_cores_running=0; // m_param_mem=NULL; // } - kernel_info_t(dim3 gridDim, dim3 blockDim, class function_info *entry); + kernel_info_t(dim3 gridDim, dim3 blockDim, class function_info *entry, + unsigned long long streamID); kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry, std::map<std::string, const struct cudaArray *> nameToCudaArray, @@ -292,6 +293,7 @@ class kernel_info_t { m_next_tid.x < m_block_dim.x; } unsigned get_uid() const { return m_uid; } + unsigned long long get_streamID() const { return m_streamID; } std::string get_name() const { return name(); } std::string name() const; @@ -325,7 +327,8 @@ class kernel_info_t { class function_info *m_kernel_entry; - unsigned m_uid; + unsigned m_uid; // Kernel ID + unsigned long long m_streamID; // These maps contain the snapshot of the texture mappings at kernel launch std::map<std::string, const struct cudaArray *> m_NameToCudaArray; @@ -900,8 +903,8 @@ class mem_fetch_interface { class mem_fetch_allocator { public: virtual mem_fetch *alloc(new_addr_type addr, mem_access_type type, - unsigned size, bool wr, - unsigned long long cycle) const = 0; + unsigned size, bool wr, unsigned long long cycle, + unsigned long long streamID) const = 0; virtual mem_fetch *alloc(const class warp_inst_t &inst, const mem_access_t &access, unsigned long long cycle) const = 0; @@ -911,7 +914,8 @@ class mem_fetch_allocator { const mem_access_sector_mask_t §or_mask, unsigned size, bool wr, unsigned long long cycle, unsigned wid, unsigned sid, unsigned tpc, - mem_fetch *original_mf) const = 0; + mem_fetch *original_mf, + unsigned long long streamID) const = 0; }; // the maximum number of destination, source, or address uarch operands in a @@ -1059,6 +1063,7 @@ class warp_inst_t : public inst_t { // constructors warp_inst_t() { m_uid = 0; + m_streamID = (unsigned long long)-1; m_empty = true; m_config = NULL; @@ -1071,6 +1076,7 @@ class warp_inst_t : public inst_t { } warp_inst_t(const core_config *config) { m_uid = 0; + m_streamID = (unsigned long long)-1; assert(config->warp_size <= MAX_WARP_SIZE); m_config = config; m_empty = true; @@ -1098,7 +1104,8 @@ class warp_inst_t : public inst_t { void clear() { m_empty = true; } void issue(const active_mask_t &mask, unsigned warp_id, - unsigned long long cycle, int dynamic_warp_id, int sch_id); + unsigned long long cycle, int dynamic_warp_id, int sch_id, + unsigned long long streamID); const active_mask_t &get_active_mask() const { return m_warp_active_mask; } void completed(unsigned long long cycle) @@ -1226,11 +1233,13 @@ class warp_inst_t : public inst_t { void print(FILE *fout) const; unsigned get_uid() const { return m_uid; } + unsigned long long get_streamID() const { return m_streamID; } unsigned get_schd_id() const { return m_scheduler_id; } active_mask_t get_warp_active_mask() const { return m_warp_active_mask; } protected: unsigned m_uid; + unsigned long long m_streamID; bool m_empty; bool m_cache_hit; unsigned long long issue_cycle; |
