summaryrefslogtreecommitdiff
path: root/src/cuda-sim
diff options
context:
space:
mode:
authorAndrew M. B. Boktor <[email protected]>2012-05-16 15:06:13 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:47:30 -0700
commitfa5f848c23042da4d71c12994b03b46818bf5b70 (patch)
treef2bc091dbc749873956b74f05d11f18620b8bd92 /src/cuda-sim
parent75e9d965938417956dece33b2e6c14dd814e4d72 (diff)
Re-wrote the intermediate structure for the output of cuobjdump using C++ classes
Some changes to remove warnings [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 12609]
Diffstat (limited to 'src/cuda-sim')
-rw-r--r--src/cuda-sim/ptx_loader.cc10
-rw-r--r--src/cuda-sim/ptx_loader.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/cuda-sim/ptx_loader.cc b/src/cuda-sim/ptx_loader.cc
index 690d6ee..4119377 100644
--- a/src/cuda-sim/ptx_loader.cc
+++ b/src/cuda-sim/ptx_loader.cc
@@ -46,7 +46,7 @@ bool g_override_embedded_ptx = false;
extern "C" int ptx_parse();
extern "C" int ptx__scan_string(const char*);
-extern "C" const char *g_ptxinfo_filename = NULL;
+const char *g_ptxinfo_filename;
extern "C" int ptxinfo_parse();
extern "C" int ptxinfo_debug;
extern "C" FILE *ptxinfo_in;
@@ -97,7 +97,7 @@ void print_ptx_file( const char *p, unsigned source_num, const char *filename )
fflush(stdout);
}
-char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const char *ptxfilename, const char *elffilename, const char *sassfilename)
+char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const std::string ptxfilename, const std::string elffilename, const std::string sassfilename)
{
printf("GPGPU-Sim PTX: converting EMBEDDED .ptx file to ptxplus \n");
@@ -110,7 +110,11 @@ char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const char *ptxfilename, con
// Run cuobjdump_to_ptxplus
char commandline[1024];
int result;
- snprintf(commandline, 1024, "$GPGPUSIM_ROOT/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus %s %s %s %s", ptxfilename, sassfilename, elffilename, fname_ptxplus);
+ snprintf(commandline, 1024, "$GPGPUSIM_ROOT/cuobjdump_to_ptxplus/cuobjdump_to_ptxplus %s %s %s %s",
+ ptxfilename.c_str(),
+ sassfilename.c_str(),
+ elffilename.c_str(),
+ fname_ptxplus);
fflush(stdout);
printf("GPGPU-Sim PTX: calling cuobjdump_to_ptxplus\ncommandline: %s\n", commandline);
result = system(commandline);
diff --git a/src/cuda-sim/ptx_loader.h b/src/cuda-sim/ptx_loader.h
index 21974e6..cb02eda 100644
--- a/src/cuda-sim/ptx_loader.h
+++ b/src/cuda-sim/ptx_loader.h
@@ -27,12 +27,13 @@
#ifndef PTX_LOADER_H_INCLUDED
#define PTX_LOADER_H_INCLUDED
+#include <string>
extern bool g_override_embedded_ptx;
class symbol_table *gpgpu_ptx_sim_load_ptx_from_string( const char *p, unsigned source_num );
void gpgpu_ptxinfo_load_from_string( const char *p_for_info, unsigned source_num );
-char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const char *ptx_str, const char *sass_str, const char *elf_str);
+char* gpgpu_ptx_sim_convert_ptx_and_sass_to_ptxplus(const std::string ptx_str, const std::string sass_str, const std::string elf_str);
bool keep_intermediate_files();
#endif