summaryrefslogtreecommitdiff
path: root/src/cuda-sim
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-06-05 17:22:35 -0700
committerJonathan <[email protected]>2018-06-05 17:22:35 -0700
commitb79708980b80b6e50b1612f5436655c724377779 (patch)
tree950ab3128ad9f43e655457afc69be60b38fb406a /src/cuda-sim
parentf7b0d64c68f12d604e09aec8dbba569df354faf6 (diff)
ptx parse only
Diffstat (limited to 'src/cuda-sim')
-rw-r--r--src/cuda-sim/ptx_loader.cc37
-rw-r--r--src/cuda-sim/ptx_parser.cc5
2 files changed, 6 insertions, 36 deletions
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc
index 0348af0..97d5773 100644
--- a/src/cuda-sim/ptx_loader.cc
+++ b/src/cuda-sim/ptx_loader.cc
@@ -152,39 +152,6 @@ char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const std::string ptxfilenam
return ptxplus_str;
}
-
-symbol_table *gpgpu_ptx_sim_load_ptx_from_string( const char *p, unsigned source_num )
-{
- char buf[1024];
- snprintf(buf,1024,"_%u.ptx", source_num );
- if( g_save_embedded_ptx ) {
- FILE *fp = fopen(buf,"w");
- fprintf(fp,"%s",p);
- fclose(fp);
- }
- symbol_table *symtab=init_parser(buf);
- ptx__scan_string(p);
- int errors = ptx_parse ();
- if ( errors ) {
- char fname[1024];
- snprintf(fname,1024,"_ptx_errors_XXXXXX");
- int fd=mkstemp(fname);
- close(fd);
- printf("GPGPU-Sim PTX: parser error detected, exiting... but first extracting .ptx to \"%s\"\n", fname);
- FILE *ptxfile = fopen(fname,"w");
- fprintf(ptxfile,"%s", p );
- fclose(ptxfile);
- abort();
- exit(40);
- }
-
- if ( g_debug_execution >= 100 )
- print_ptx_file(p,source_num,buf);
-
- printf("GPGPU-Sim PTX: finished parsing EMBEDDED .ptx file %s\n",buf);
- return symtab;
-}
-
symbol_table *gpgpu_ptx_sim_load_ptx_from_filename( const char *filename )
{
symbol_table *symtab=init_parser(filename);
@@ -321,6 +288,10 @@ char* get_app_binary_name(){
return self_exe_path;
}
+void gpgpu_ptx_info_load_from_filename( const char *filename )
+{
+}
+
void gpgpu_ptxinfo_load_from_string( const char *p_for_info, unsigned source_num, unsigned sm_version )
{
//do ptxas for individual files instead of one big embedded ptx. This prevents the duplicate defs and declarations.
diff --git a/src/cuda-sim/ptx_parser.cc b/src/cuda-sim/ptx_parser.cc
index 06ca870..c418fac 100644
--- a/src/cuda-sim/ptx_parser.cc
+++ b/src/cuda-sim/ptx_parser.cc
@@ -142,9 +142,7 @@ symbol_table *init_parser( const char *ptx_filename )
g_global_allfiles_symbol_table = new symbol_table("global_allfiles", 0, NULL);
g_global_symbol_table = g_current_symbol_table = g_global_allfiles_symbol_table;
}
-// else {
-// g_global_symbol_table = g_current_symbol_table = new symbol_table("global",0,g_global_allfiles_symbol_table);
-// }
+
ptx_lineno = 1;
#define DEF(X,Y) g_ptx_token_decode[X] = Y;
@@ -164,6 +162,7 @@ symbol_table *init_parser( const char *ptx_filename )
g_ptx_token_decode[global_space] = "global_space";
g_ptx_token_decode[generic_space] = "generic_space";
g_ptx_token_decode[instruction_space] = "instruction_space";
+
init_directive_state();
init_instruction_state();