summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_parser.cc
diff options
context:
space:
mode:
authortgrogers <[email protected]>2019-07-12 10:30:08 -0400
committertgrogers <[email protected]>2019-07-12 10:30:08 -0400
commit89e913f7b28e342b9023a01105cb441cfafbee8b (patch)
tree39224ede8f55cac67884b92100e3d50451e635ba /src/cuda-sim/ptx_parser.cc
parent3429bfacff71a0da92ffb05e964c90dbf26ccac0 (diff)
parentaa12db699a540ea7b4ed4b913be6ef3155fc68d6 (diff)
Merge branch 'dev' of github.com:purdue-aalp/gpgpu-sim_distribution into dev
Diffstat (limited to 'src/cuda-sim/ptx_parser.cc')
-rw-r--r--src/cuda-sim/ptx_parser.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/cuda-sim/ptx_parser.cc b/src/cuda-sim/ptx_parser.cc
index 05fc618..5a94679 100644
--- a/src/cuda-sim/ptx_parser.cc
+++ b/src/cuda-sim/ptx_parser.cc
@@ -112,7 +112,7 @@ symbol_table * gpgpu_context::init_parser( const char *ptx_filename )
{
g_filename = strdup(ptx_filename);
if (g_global_allfiles_symbol_table == NULL) {
- g_global_allfiles_symbol_table = new symbol_table("global_allfiles", 0, NULL);
+ g_global_allfiles_symbol_table = new symbol_table("global_allfiles", 0, NULL, this);
ptx_parser->g_global_symbol_table = ptx_parser->g_current_symbol_table = g_global_allfiles_symbol_table;
}
/*else {
@@ -285,7 +285,8 @@ void ptx_recognizer::add_instruction()
gpgpu_ctx->g_filename,
ptx_get_lineno(scanner),
linebuf,
- g_shader_core_config );
+ g_shader_core_config,
+ gpgpu_ctx );
g_instructions.push_back(i);
g_inst_lookup[gpgpu_ctx->g_filename][ptx_get_lineno(scanner)] = i;
init_instruction_state();
@@ -321,9 +322,6 @@ bool ptx_recognizer::check_for_duplicates( const char *identifier )
return ( s != NULL );
}
-extern std::set<std::string> g_globals;
-extern std::set<std::string> g_constants;
-
// Returns padding that needs to be inserted ahead of address to make it aligned to min(size, maxalign)
/*
* @param address the address in bytes
@@ -452,7 +450,7 @@ void ptx_recognizer::add_identifier( const char *identifier, int array_dim, unsi
g_current_symbol_table->alloc_global( num_bits/8 + addr_pad );
}
if( g_current_symbol_table == g_global_symbol_table ) {
- g_constants.insert( identifier );
+ gpgpu_ctx->func_sim->g_constants.insert( identifier );
}
assert( g_current_symbol_table != NULL );
g_sym_name_to_symbol_table[ identifier ] = g_current_symbol_table;
@@ -470,7 +468,7 @@ void ptx_recognizer::add_identifier( const char *identifier, int array_dim, unsi
fflush(stdout);
g_last_symbol->set_address( addr+addr_pad );
g_current_symbol_table->alloc_global( num_bits/8 + addr_pad );
- g_globals.insert( identifier );
+ gpgpu_ctx->func_sim->g_globals.insert( identifier );
assert( g_current_symbol_table != NULL );
g_sym_name_to_symbol_table[ identifier ] = g_current_symbol_table;
break;