diff options
| author | Andrew M. B. Boktor <[email protected]> | 2012-05-04 09:51:53 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:19:37 -0700 |
| commit | 05f02e48963660d60120aca2f0198e0723e257d5 (patch) | |
| tree | ca3a86afb038eb3d6bcaaee15a0fa587e19b881d /src/cuda-sim/ptx_loader.cc | |
| parent | 2893b0694e028d62e7b0849024b620a50a409de0 (diff) | |
Supporting the option for removing temporary files
. the option -gpgpu_ptx_save_converted_ptxplus allows keeping the ptxplus file
. the option -gpgpu_keep allows keeping intermediate files used to communicate with other programs (e.g. cuobjdump)
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12304]
Diffstat (limited to 'src/cuda-sim/ptx_loader.cc')
| -rw-r--r-- | src/cuda-sim/ptx_loader.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc index cbfa9f4..d405288 100644 --- a/src/cuda-sim/ptx_loader.cc +++ b/src/cuda-sim/ptx_loader.cc @@ -53,6 +53,9 @@ extern "C" FILE *ptxinfo_in; static bool g_save_embedded_ptx; bool g_keep_intermediate_files; +bool m_ptx_save_converted_ptxplus; + +bool keep_intermediate_files() {return g_keep_intermediate_files;} void ptx_reg_options(option_parser_t opp) { @@ -62,6 +65,10 @@ void ptx_reg_options(option_parser_t opp) option_parser_register(opp, "-keep", OPT_BOOL, &g_keep_intermediate_files, "keep intermediate files created by GPGPU-Sim when interfacing with external programs", "0"); + option_parser_register(opp, "-gpgpu_ptx_save_converted_ptxplus", OPT_BOOL, + &m_ptx_save_converted_ptxplus, + "Saved converted ptxplus to a file", + "0"); } void print_ptx_file( const char *p, unsigned source_num, const char *filename ) @@ -125,20 +132,18 @@ char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const char *ptxfilename, con char* ptxplus_str = new char [strlen(text.c_str())+1]; strcpy(ptxplus_str, text.c_str()); - // Remove temporary files - // TODO: Fix deleting/keeping PTXPlus files - /* - char rm_commandline[1024]; + if (!m_ptx_save_converted_ptxplus){ + char rm_commandline[1024]; - snprintf(rm_commandline,1024,"rm -f %s", fname_ptxplus); + snprintf(rm_commandline,1024,"rm -f %s", fname_ptxplus); - printf("GPGPU-Sim PTX: removing temporary files using \"%s\"\n", rm_commandline); - int rm_result = system(rm_commandline); - if( rm_result != 0 ) { - printf("GPGPU-Sim PTX: ERROR ** while removing temporary files %d\n", rm_result); - exit(1); + printf("GPGPU-Sim PTX: removing temporary files using \"%s\"\n", rm_commandline); + int rm_result = system(rm_commandline); + if( rm_result != 0 ) { + printf("GPGPU-Sim PTX: ERROR ** while removing temporary files %d\n", rm_result); + exit(1); + } } - */ printf("GPGPU-Sim PTX: DONE converting EMBEDDED .ptx file to ptxplus \n"); return ptxplus_str; |
