diff options
| author | Jonathan <[email protected]> | 2018-07-23 14:20:14 -0700 |
|---|---|---|
| committer | Jonathan <[email protected]> | 2018-07-23 14:20:14 -0700 |
| commit | bd9a49ef576bfbbaf2be1d163eb99b7316f7bd20 (patch) | |
| tree | 1f4f060b4004d5edb216655a1a9e877fd62b21b3 /libcuda | |
| parent | e22b3179ccdee8bfbd1e74f86d93e0d7fc9ae6dc (diff) | |
brought back ptxinfo
Diffstat (limited to 'libcuda')
| -rw-r--r-- | libcuda/cuda_runtime_api.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index db4f58e..c87c6c3 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -152,7 +152,8 @@ std::map<void *,void **> pinned_memory; //support for pinned memories added std::map<void *, size_t> pinned_memory_size; std::map<unsigned long long, size_t> g_mallocPtr_Size; int no_of_ptx=0; -std::map<int, std::set<std::string> > version_filename; +//maps sm version number to set of filenames +std::map<unsigned, std::set<std::string> > version_filename; extern void synchronize(); extern void exit_simulation(); @@ -1718,7 +1719,8 @@ char* get_app_binary_name(std::string abs_path){ } //extracts all ptx files from binary and dumps into prog_name.unique_no.sm_<>.ptx files -void extract_ptx_files_using_cuobjdump(bool g_cdp_enabled){ +void extract_ptx_files_using_cuobjdump(){ + extern bool g_cdp_enabled; char command[1000]; std::string app_binary = get_app_binary(); @@ -1808,7 +1810,8 @@ void extract_code_using_cuobjdump(){ //dump ptx for all individial ptx files into sepearte files which is later used by ptxas. int result=0; #if (CUDART_VERSION >= 6000) - extract_ptx_files_using_cuobjdump(g_cdp_enabled); + extract_ptx_files_using_cuobjdump(); + return; #endif //TODO: redundant to dump twice. how can it be prevented? //dump only for specific arch @@ -2168,7 +2171,7 @@ void cuobjdumpParseBinary(unsigned int handle){ #if (CUDART_VERSION >= 6000) //loops through all ptx files from smallest sm version to largest - std::map<int,std::set<std::string> >::iterator itr_m; + std::map<unsigned,std::set<std::string> >::iterator itr_m; for (itr_m = version_filename.begin(); itr_m!=version_filename.end(); itr_m++){ std::set<std::string>::iterator itr_s; for (itr_s = itr_m->second.begin(); itr_s!=itr_m->second.end(); itr_s++){ @@ -2181,6 +2184,14 @@ void cuobjdumpParseBinary(unsigned int handle){ context->add_binary(symtab, handle); load_static_globals(symtab,STATIC_ALLOC_LIMIT,0xFFFFFFFF,context->get_device()->get_gpgpu()); load_constants(symtab,STATIC_ALLOC_LIMIT,context->get_device()->get_gpgpu()); + for (itr_m = version_filename.begin(); itr_m!=version_filename.end(); itr_m++){ + std::set<std::string>::iterator itr_s; + for (itr_s = itr_m->second.begin(); itr_s!=itr_m->second.end(); itr_s++){ + std::string ptx_filename = *itr_s; + printf("GPGPU-Sim PTX: Loading PTXInfo from %s\n",ptx_filename.c_str()); + gpgpu_ptx_info_load_from_filename( ptx_filename.c_str(), itr_m->first ); + } + } return; #endif |
