From 0196ec27fff8ca9b58aa30c7a382fd439ace48e1 Mon Sep 17 00:00:00 2001 From: "Andrew M. B. Boktor" Date: Wed, 8 Aug 2012 21:10:05 -0800 Subject: Fixing bug #7 on gpgpu-sim.org [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13705] --- libcuda/cuda_runtime_api.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libcuda') 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::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++; -- cgit v1.3