diff options
| author | Jonathan <[email protected]> | 2018-06-01 13:04:30 -0700 |
|---|---|---|
| committer | Jonathan <[email protected]> | 2018-06-01 13:04:30 -0700 |
| commit | 2278609c8e279e7dfba49211256e818e3152318b (patch) | |
| tree | 1403c896f5500af7cffac8a9d138ab0329703b66 /src/cuda-sim/ptx_loader.cc | |
| parent | c175eeab56567165f4be72b87746439ad0837c6e (diff) | |
WIP attempting to parse ptx files in order
Diffstat (limited to 'src/cuda-sim/ptx_loader.cc')
| -rw-r--r-- | src/cuda-sim/ptx_loader.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc index 33a4260..8deafc6 100644 --- a/src/cuda-sim/ptx_loader.cc +++ b/src/cuda-sim/ptx_loader.cc @@ -185,6 +185,26 @@ symbol_table *gpgpu_ptx_sim_load_ptx_from_string( const char *p, unsigned source return symtab; } +symbol_table *gpgpu_ptx_sim_load_ptx_from_filename( const char *filename ) +{ + symbol_table *symtab=init_parser(filename); + 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"); + fclose(ptxfile); + abort(); + exit(40); + } + + printf("GPGPU-Sim PTX: finished parsing EMBEDDED .ptx file %s\n",filename); + return symtab; +} + void fix_duplicate_errors(char fname2[1024]) { char tempfile[1024] = "_temp_ptx"; char commandline[1024]; |
