diff options
| author | Wilson Fung <[email protected]> | 2012-11-21 19:32:45 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:49:22 -0700 |
| commit | e80d362d284e19f4c6415284fb0a1d5f4e85f6f8 (patch) | |
| tree | 715e4ae2abb3b77f7fc5d82c189637ec7cf8e1b7 /aerialvision | |
| parent | 6e0aab40706497ef4e3046d5614b0061f538f300 (diff) | |
Fixed .loc directive parsing for PC-Histogram (CFLog) in AerialVision.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14635]
Diffstat (limited to 'aerialvision')
| -rw-r--r-- | aerialvision/lexyacctexteditor.py | 15 | ||||
| -rw-r--r-- | aerialvision/organizedata.py | 25 |
2 files changed, 13 insertions, 27 deletions
diff --git a/aerialvision/lexyacctexteditor.py b/aerialvision/lexyacctexteditor.py index 757a090..51d3ced 100644 --- a/aerialvision/lexyacctexteditor.py +++ b/aerialvision/lexyacctexteditor.py @@ -63,6 +63,7 @@ import sys +import re sys.path.insert(0,"Lib/site-packages/ply-3.2/ply-3.2") import ply.lex as lex import ply.yacc as yacc @@ -145,15 +146,11 @@ def ptxToCudaMapping(filename): except: map[loc] = [] map[loc].append(count) - try: - line.index('.loc') - try: - line.index('.local') - except: - lineList = line.split('\t') - loc = int(lineList[3]) - except: - pass + + m = re.search('\.loc\s+(\d+)\s+(\d+)\s+(\d+)', line) + if (m != None): + loc = int(m.group(2)) + count += 1 x = map.keys() return map diff --git a/aerialvision/organizedata.py b/aerialvision/organizedata.py index 6ca181c..0b547b3 100644 --- a/aerialvision/organizedata.py +++ b/aerialvision/organizedata.py @@ -136,6 +136,7 @@ def organizedata(fileVars): for lines in map: for ptxLines in map[lines]: newMap[ptxLines] = lines + print " Total number of CUDA src lines = %s..." % len(newMap) markForDel = [] for ptxLines in newMap: @@ -143,9 +144,8 @@ def organizedata(fileVars): markForDel.append(ptxLines) for lines in markForDel: del newMap[lines] + print " Number of touched CUDA src lines = %s..." % len(newMap) - - fileVars['CFLOGglobalPTX'] = vc.variable('',2,0) fileVars['CFLOGglobalCUDA'] = vc.variable('',2,0) @@ -162,17 +162,17 @@ def organizedata(fileVars): try: if count == 0: - fileVars['globalPTX'] = fileVars[iter + 'PTX'] + fileVars['CFLOGglobalPTX'] = fileVars[iter + 'PTX'] if parseCFLOGCUDA == 1: - fileVars['globalCUDA'] = fileVars[iter + 'CUDA'] + fileVars['CFLOGglobalCUDA'] = fileVars[iter + 'CUDA'] else: for rows in range(0, len(fileVars[iter + 'PTX'].data)): for columns in range(0, len(fileVars[iter + 'PTX'].data[rows])): - fileVars['globalPTX'].data[rows][columns] += fileVars[iter + 'PTX'].data[rows][columns] + fileVars['CFLOGglobalPTX'].data[rows][columns] += fileVars[iter + 'PTX'].data[rows][columns] if parseCFLOGCUDA == 1: for rows in range(0, len(fileVars[iter + 'CUDA'].data)): for columns in range(0, len(fileVars[iter + 'CUDA'].data[rows])): - fileVars['globalCUDA'].data[rows][columns] += fileVars[iter + 'CUDA'].data[rows][columns] + fileVars['CFLOGglobalCUDA'].data[rows][columns] += fileVars[iter + 'CUDA'].data[rows][columns] except: print "Error in generating globalCFLog data" @@ -313,7 +313,7 @@ def CFLOGOrganizeCuda(list, ptx2cudamap): cudaMaxLineNo = max(ptx2cudamap.keys()) tmp = {} #need to fill up the final matrix appropriately - + nSamples = len(list[0]) # create a dictionary of empty data array (one array per cuda source line) @@ -341,17 +341,6 @@ def CFLOGOrganizeCuda(list, ptx2cudamap): return final - #final[lines][lengthData] += 0 - #list[ptxLines][lengthData] += 0 - - #print final - - - - - - - #def stackedBar(nullVar): # #Need to initialize organize ar # organized = [[]] |
