summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_ir.cc
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2019-07-15 13:57:48 -0400
committerMengchi Zhang <[email protected]>2019-07-15 13:57:48 -0400
commit971722f51189e80034a9c80a4846a4ec045f0d4d (patch)
treef4069e1be6c6aa0541fd5d54e252360f07107b18 /src/cuda-sim/ptx_ir.cc
parent3b88f9db669d8ec9ffc477352dcfd2a3d423781f (diff)
Move g_ptx_cta_info_uid and symbol::sm_next_uid
Signed-off-by: Mengchi Zhang <[email protected]>
Diffstat (limited to 'src/cuda-sim/ptx_ir.cc')
-rw-r--r--src/cuda-sim/ptx_ir.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc
index 849cc5d..3719fb2 100644
--- a/src/cuda-sim/ptx_ir.cc
+++ b/src/cuda-sim/ptx_ir.cc
@@ -43,11 +43,9 @@ typedef void * yyscan_t;
#define STR_SIZE 1024
-unsigned symbol::sm_next_uid = 1;
-
unsigned symbol::get_uid()
{
- unsigned result = sm_next_uid++;
+ unsigned result = (gpgpu_ctx->symbol_sm_next_uid)++;
return result;
}
@@ -152,7 +150,7 @@ symbol *symbol_table::add_variable( const char *identifier, const type_info *typ
std::string key(identifier);
assert( m_symbols.find(key) == m_symbols.end() );
snprintf(buf,1024,"%s:%u",filename,line);
- symbol *s = new symbol(identifier,type,buf,size);
+ symbol *s = new symbol(identifier,type,buf,size,gpgpu_ctx);
m_symbols[ key ] = s;
if ( type != NULL && type->get_key().is_global() ) {
@@ -173,7 +171,7 @@ void symbol_table::add_function( function_info *func, const char *filename, unsi
char buf[1024];
snprintf(buf,1024,"%s:%u",filename,linenumber);
type_info *type = add_type( func );
- symbol *s = new symbol(func->get_name().c_str(),type,buf,0);
+ symbol *s = new symbol(func->get_name().c_str(),type,buf,0,gpgpu_ctx);
s->set_function(func);
m_symbols[ func->get_name() ] = s;
}