summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--aerialvision/lexyacctexteditor.py15
-rw-r--r--aerialvision/organizedata.py25
3 files changed, 14 insertions, 27 deletions
diff --git a/CHANGES b/CHANGES
index 23d2db2..e9620e5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -67,6 +67,7 @@ Version 3.1.1+edits (development branch) versus 3.1.1
- Fixed the timing model for LDU instruction, before it was not recognized
as a memory instruction in the timing model.
- Removed memory leak in cudaSetupArgument().
+ - Fixed .loc directive parsing for PC-Histogram (CFLog) in AerialVision.
Version 3.1.1 versus 3.1.0
- Add checks to top level makefile to ensure setup_environment is run and checks to
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 = [[]]