本文整理汇总了Python中Debug.exitMessage方法的典型用法代码示例。如果您正苦于以下问题:Python Debug.exitMessage方法的具体用法?Python Debug.exitMessage怎么用?Python Debug.exitMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug.exitMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkCommandLineForAction
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import exitMessage [as 别名]
def checkCommandLineForAction ():
# Check that the user has passed the correct options
if opts.tests > 0:
cudaBinary = args[0]
if not os.path.exists(cudaBinary):
Debug.exitMessage("The argument '%s' does not exist" % cudaBinary)
elif not os.path.isfile(cudaBinary):
Debug.exitMessage("The argument '%s' is not a file" % cudaBinary)
elif not os.access(cudaBinary, os.X_OK):
Debug.exitMessage("The argument '%s' does not have execute permission" % cudaBinary)
# Get the filename of the binary without the path
basename = os.path.basename(cudaBinary)
basepath = os.path.abspath(os.path.dirname(cudaBinary))
generatedFiles = runCUDAKernel(basepath)
doAnalysis(generatedFiles, basename, basepath)
elif len(args) > 0:
for arg in args:
if not arg.endswith(gpgpuFileExt):
Debug.exitMessage("Each file must end with a '%s' suffix. You passed '%s'." % (gpgpuFileExt, arg))
basename = os.path.splitext(os.path.basename(args[0]))[0]
basepath = os.path.abspath(os.path.dirname(args[0]))
doAnalysis(args, basename, basepath)
else:
Debug.exitMessage("""There are two ways to run this script:
1) Either pass a CUDA binary as an argument and the number of times you want to run the kernel with the -T option; or
2) Pass a number of files that were generated by GPGPU-sim from a previous testing run""")
示例2: __solve
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import exitMessage [as 别名]
def __solve(self, ipg, ilpFile):
from subprocess import Popen, PIPE
import shlex
Debug.debugMessage("Solving ILP", 10)
command = "lp_solve %s" % ilpFile
proc = Popen(command, shell=True, executable="/bin/bash", stdout=PIPE, stderr=PIPE)
returnCode = proc.wait()
if returnCode != 0:
Debug.exitMessage("Running '%s' failed" % command)
for line in proc.stdout.readlines():
if line.startswith("Value of objective function"):
lexemes = shlex.split(line)
wcet = long(decimal.Decimal(lexemes[-1]))
self.__wcet = wcet
示例3: __doParsing
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import exitMessage [as 别名]
def __doParsing (self, program):
newTrace = True
currentv = None
lastTime = 0
startTime = 0
ipg = None
for t in self.warpTrace.getTrace():
ipointID = int(t[0], 0)
time = long(t[1])
Debug.debugMessage("Trace tuple (0x%04X, %d)" % (ipointID, time), 10)
if newTrace:
ipg = self.__getIPG(program, ipointID)
functionName = ipg.getName()
self.numberOfTraces[functionName] += 1
newTrace = False
currentv = ipg.getVertex(ipg.getEntryID())
assert currentv.getIpointID () == ipointID
lastTime = time
startTime = time
else:
succID = currentv.getIpointSuccessor(ipointID)
if succID:
succe = currentv.getSuccessorEdge(succID)
self.__analyseEdgeTime(succe, time - lastTime)
# Advance transition
lastTime = time
currentv = ipg.getVertex(succID)
if succID == ipg.getExitID():
newTrace = True
runTime = lastTime - startTime
functionName = ipg.getName()
self.totalEnd2End[functionName] += runTime
if runTime > self.highWaterMark[functionName]:
self.highWaterMark[functionName] = runTime
self.__analyseWorstCaseExecutionCounts()
ipg = None
else:
Debug.exitMessage("Giving up")
示例4: setEntryAndExit
# 需要导入模块: import Debug [as 别名]
# 或者: from Debug import exitMessage [as 别名]
def setEntryAndExit (cfg):
withoutPred = []
withoutSucc = []
for bb in cfg:
if bb.numberOfSuccessors() == 0:
withoutSucc.append(bb.getVertexID())
elif bb.numberOfSuccessors() == 1:
if bb.hasSuccessor(bb.getVertexID()):
withoutSucc.append(bb.getVertexID())
if bb.numberOfPredecessors() == 0:
withoutPred.append(bb.getVertexID())
elif bb.numberOfPredecessors() == 1:
if bb.hasPredecessor(bb.getVertexID()):
withoutPred.append(bb.getVertexID())
if len(withoutPred) == 0:
Debug.exitMessage("CFG '%s' does not an entry point" % cfg.getName())
elif len(withoutPred) > 1:
debugStr = ""
for bbID in withoutPred:
bb = cfg.getVertex(bbID)
debugStr += bb.__str__()
Debug.exitMessage("CFG '%s' has too many entry points: %s" % (cfg.getName(), debugStr))
else:
cfg.setEntryID(withoutPred[0])
if len(withoutSucc) == 0:
Debug.exitMessage("CFG '%s' does not an exit point" % cfg.getName())
elif len(withoutSucc) > 1:
debugStr = ""
for bbID in withoutSucc:
bb = cfg.getVertex(bbID)
debugStr += bb.__str__()
Debug.exitMessage("CFG '%s' has too many exit points: %s" % (cfg.getName(), debugStr))
else:
cfg.setExitID(withoutSucc[0])