diff options
| author | Andrew M. B. Boktor <[email protected]> | 2012-08-08 21:10:05 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:48:53 -0700 |
| commit | 0196ec27fff8ca9b58aa30c7a382fd439ace48e1 (patch) | |
| tree | 91b929df0eec2163d282df219cca2ba3c06498de /libcuda | |
| parent | c00424bbb3187f4f9a4718d4d7c078c0c8ff9f73 (diff) | |
Fixing bug #7 on gpgpu-sim.org
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13705]
Diffstat (limited to 'libcuda')
| -rw-r--r-- | libcuda/cuda_runtime_api.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index e189403..35207bd 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -1350,7 +1350,7 @@ void useCuobjdump() { unsigned source_num=1; extract_code_using_cuobjdump(); //extract all the output of cuobjdump to _cuobjdump_*.* cuobjdumpSectionList = pruneSectionList(cuobjdumpSectionList, context); - unsigned total_ptx_files = cuobjdumpSectionList.size()/2; + unsigned total_ptx_files = cuobjdumpSectionList.size()/2 + 1; for ( std::list<cuobjdumpSection*>::iterator iter2 = cuobjdumpSectionList.begin(); iter2 != cuobjdumpSectionList.end(); @@ -1369,14 +1369,14 @@ void useCuobjdump() { elfsection->getELFfilename(), elfsection->getSASSfilename()); symtab=gpgpu_ptx_sim_load_ptx_from_string(ptxplus_str,source_num); - printf("Adding %s with cubin handle %u\n", iter->getPTXfilename().c_str(), source_num); - context->add_binary(symtab, source_num); + printf("Adding %s with cubin handle %u\n", iter->getPTXfilename().c_str(), total_ptx_files-source_num); + context->add_binary(symtab, total_ptx_files-source_num); gpgpu_ptxinfo_load_from_string( ptxcode,total_ptx_files-source_num); delete[] ptxplus_str; } else { symtab=gpgpu_ptx_sim_load_ptx_from_string(ptxcode, source_num); - printf("Adding %s with cubin handle %u\n", iter->getPTXfilename().c_str(), source_num); - context->add_binary(symtab,source_num); + printf("Adding %s with cubin handle %u\n", iter->getPTXfilename().c_str(), total_ptx_files-source_num); + context->add_binary(symtab,total_ptx_files-source_num); gpgpu_ptxinfo_load_from_string( ptxcode, total_ptx_files-source_num); } source_num++; |
