summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2019-07-14 13:06:46 -0400
committerMengchi Zhang <[email protected]>2019-07-14 13:06:46 -0400
commitc4782ba3c78e6e97db9f56780991dc5cf827c755 (patch)
treebe0ae8c2ba10ec077de747ad04f0f095aa1e2656
parent23c0bb224295dde9651fd915d854e4f7eafdf88f (diff)
Move warp_inst_sm_next_uid
Signed-off-by: Mengchi Zhang <[email protected]>
-rw-r--r--libcuda/gpgpu_context.h2
-rw-r--r--src/abstract_hardware_model.cc15
-rw-r--r--src/abstract_hardware_model.h18
3 files changed, 18 insertions, 17 deletions
diff --git a/libcuda/gpgpu_context.h b/libcuda/gpgpu_context.h
index 07473be..0dd6311 100644
--- a/libcuda/gpgpu_context.h
+++ b/libcuda/gpgpu_context.h
@@ -12,6 +12,7 @@ class gpgpu_context {
gpgpu_context() {
g_global_allfiles_symbol_table = NULL;
sm_next_access_uid=0;
+ warp_inst_sm_next_uid=0;
api = new cuda_runtime_api(this);
ptxinfo = new ptxinfo_data(this);
ptx_parser = new ptx_recognizer(this);
@@ -23,6 +24,7 @@ class gpgpu_context {
symbol_table *g_global_allfiles_symbol_table;
const char *g_filename;
unsigned sm_next_access_uid;
+ unsigned warp_inst_sm_next_uid;
// objects pointers for each file
cuda_runtime_api* api;
ptxinfo_data* ptxinfo;
diff --git a/src/abstract_hardware_model.cc b/src/abstract_hardware_model.cc
index fe10daa..1dddecd 100644
--- a/src/abstract_hardware_model.cc
+++ b/src/abstract_hardware_model.cc
@@ -41,8 +41,6 @@
#include <iostream>
#include "../libcuda/gpgpu_context.h"
-unsigned warp_inst_t::sm_next_uid = 0;
-
void mem_access_t::init(gpgpu_context* ctx)
{
gpgpu_ctx = ctx;
@@ -50,6 +48,19 @@ void mem_access_t::init(gpgpu_context* ctx)
m_addr=0;
m_req_size=0;
}
+void warp_inst_t::issue( const active_mask_t &mask, unsigned warp_id, unsigned long long cycle, int dynamic_warp_id, int sch_id )
+{
+ m_warp_active_mask = mask;
+ m_warp_issued_mask = mask;
+ m_uid = ++(m_config->gpgpu_ctx->warp_inst_sm_next_uid);
+ m_warp_id = warp_id;
+ m_dynamic_warp_id = dynamic_warp_id;
+ issue_cycle = cycle;
+ cycles = initiation_interval;
+ m_cache_hit=false;
+ m_empty=false;
+ m_scheduler_id=sch_id;
+}
checkpoint::checkpoint()
{
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index a22c8c3..519416d 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -958,19 +958,9 @@ public:
{
m_empty=true;
}
- void issue( const active_mask_t &mask, unsigned warp_id, unsigned long long cycle, int dynamic_warp_id, int sch_id )
- {
- m_warp_active_mask = mask;
- m_warp_issued_mask = mask;
- m_uid = ++sm_next_uid;
- m_warp_id = warp_id;
- m_dynamic_warp_id = dynamic_warp_id;
- issue_cycle = cycle;
- cycles = initiation_interval;
- m_cache_hit=false;
- m_empty=false;
- m_scheduler_id=sch_id;
- }
+
+ void issue( const active_mask_t &mask, unsigned warp_id, unsigned long long cycle, int dynamic_warp_id, int sch_id );
+
const active_mask_t & get_active_mask() const
{
return m_warp_active_mask;
@@ -1133,8 +1123,6 @@ protected:
bool m_mem_accesses_created;
std::list<mem_access_t> m_accessq;
- static unsigned sm_next_uid;
-
unsigned m_scheduler_id; //the scheduler that issues this inst
//Jin: cdp support