summaryrefslogtreecommitdiff
path: root/aerialvision/variableclasses.py
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-01 08:55:28 -0800
committerTor Aamodt <[email protected]>2010-10-01 08:55:28 -0800
commit11b308e7363e937966b035b4891db32b4eece3bf (patch)
tree50ca4c9ad6f163ac4acb2bf505e64dfebed66947 /aerialvision/variableclasses.py
parentbb820c116764d7a1b8e071137d32b74e7f34dd2f (diff)
integrating recent changes from fermi-test into fermi
(i'll use "fermi" for more disruptive changes to the pipeline model such as updating the MSHRs and getting rid of the warp tracker, ripping out DWF, etc...) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7805]
Diffstat (limited to 'aerialvision/variableclasses.py')
-rw-r--r--aerialvision/variableclasses.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/aerialvision/variableclasses.py b/aerialvision/variableclasses.py
index cf24c29..18850a1 100644
--- a/aerialvision/variableclasses.py
+++ b/aerialvision/variableclasses.py
@@ -71,12 +71,14 @@ class variable:
self.bool = bool # wheither to expect reset at the end of a kernel
self.organize = organize # how is the data organize in the log, see organizedata.py for options
self.datatype = datatype # int or float or other custom type?
+ self.initialized = 0
+ self.sampleNum = 0
# import the stat variable setting from a string in variables.txt or a custom header
def importFromString(self, string_spec):
data_type_str = {'int':int, 'float':float}
- plot_type_str = {'scalar': 1, 'vector': 2, 'stackedbar': 3, 'vector2d': 4}
- organize_str = {'scalar': 'scalar', 'implicit': 'impVec', 'index': 'idxVec', 'index2d': 'idx2DVec'} #skip custom
+ plot_type_str = {'scalar': 1, 'vector': 2, 'stackedbar': 3, 'vector2d': 4, 'sparse': 5}
+ organize_str = {'scalar': 'scalar', 'implicit': 'impVec', 'index': 'idxVec', 'index2d': 'idx2DVec', 'sparse': 'sparse'} #skip custom
try:
# initialize new stat variable with info from input string
@@ -95,13 +97,21 @@ class variable:
elif (self.type == 2):
assert(self.organize in ['impVec', 'idxVec'])
elif (self.type == 3):
- assert(self.organize in ['impVec', 'idxVec'])
+ assert(self.organize == 'stackbar')
elif (self.type == 4):
assert(self.organize == 'idx2DVec')
+ elif (self.type == 5):
+ assert(self.organize == 'sparse')
except Exception, (e):
print "Error in creating new stat variable from string: %s" % string_spec
raise e
-
+
+ def initSparseMatrix(self):
+ if (self.initialized == 0):
+ if (self.type != 5): raise Exception("initSparseMatrix called from wrong variable type")
+ self.data = [[], [], []]
+ self.initialized = 1
+ self.sampleNum = 1
class bookmark: