From 7ac360c0a2defc5612fec6a106c703145e642aaa Mon Sep 17 00:00:00 2001 From: Ahmed ElTantawy Date: Fri, 13 May 2016 09:38:58 -0700 Subject: detailed error message when minimum found ptx capability is still larger than the maximum forced capability --- libcuda/cuda_runtime_api.cc | 22 ++++++++++++++-------- libcuda/cuobjdump.y | 6 ++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index 7495767..f2e3359 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -1457,18 +1457,22 @@ std::list pruneSectionList(std::list cuobj std::list prunedList; - //Find the highest capability (that is lower than the forces maximum) for each cubin file + //Find the highest capability (that is lower than the forced maximum) for each cubin file //and set it in cuobjdumpSectionMap. Do this only for ptx sections std::map cuobjdumpSectionMap; + int min_ptx_capability_found=0; for ( std::list::iterator iter = cuobjdumpSectionList.begin(); iter != cuobjdumpSectionList.end(); iter++){ unsigned capability = (*iter)->getArch(); - if(dynamic_cast(*iter) != NULL && - (capability <= forced_max_capability || - forced_max_capability==0)) { - if(cuobjdumpSectionMap[(*iter)->getIdentifier()] < capability) - cuobjdumpSectionMap[(*iter)->getIdentifier()] = capability; + if(dynamic_cast(*iter) != NULL){ + if(capabilitygetIdentifier()] < capability) || + (cuobjdumpSectionMap.find((*iter)->getIdentifier())==cuobjdumpSectionMap.end())) + cuobjdumpSectionMap[(*iter)->getIdentifier()] = capability; + } } } @@ -1484,8 +1488,10 @@ std::list pruneSectionList(std::list cuobj delete *iter; } } - - assert(!prunedList.empty() && "WARNING: Change -gpgpu_ptx_force_max_capability in gpgpusim.config to match the largest Gencode argument in the Makefile"); + if(prunedList.empty()){ + printf("Error: No PTX sections found with sm capability that is lower than current forced maximum capability \n minimum ptx capability found = %u, maximum forced ptx capability = %u \n User might want to change either the forced maximum capability from gpgpusim configuration or update the compilation to generate the required PTX version",min_ptx_capability_found,forced_max_capability); + abort(); + } return prunedList; } diff --git a/libcuda/cuobjdump.y b/libcuda/cuobjdump.y index 29509e8..dce7e3d 100644 --- a/libcuda/cuobjdump.y +++ b/libcuda/cuobjdump.y @@ -39,7 +39,6 @@ void setCuobjdumpelffilename(const char* filename); void setCuobjdumpsassfilename(const char* filename); int elfserial = 1; int ptxserial = 1; -int yydebug = 1; FILE *ptxfile; FILE *elffile; FILE *sassfile; @@ -84,7 +83,6 @@ section : PTXHEADER { elffile = fopen(filename, "w"); setCuobjdumpelffilename(filename); } headerinfo identifier{ - printf("\nHeader Info and Identifier Parsed\n"); } elfcode { fclose(elffile); snprintf(filename, 1024, "_cuobjdump_%d.sass", elfserial++); @@ -107,8 +105,8 @@ headerinfo : H_SEPARATOR NEWLINE H_HOST IDENTIFIER NEWLINE H_COMPILESIZE IDENTIFIER {setCuobjdumparch($4);}; -identifier : H_IDENTIFIER FILENAME emptylines {setCuobjdumpidentifier($2);}; - | ; +identifier : H_IDENTIFIER FILENAME emptylines {setCuobjdumpidentifier($2);} + | {setCuobjdumpidentifier("default");}; compressedkeyword : H_COMPRESSED emptylines | ; -- cgit v1.3