Skip to content

Commit

Permalink
apply yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
tgerdesnv authored and debermudez committed Sep 15, 2020
1 parent 9312f81 commit 8f10ef8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 31 deletions.
4 changes: 2 additions & 2 deletions pyprof/parse/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def setRunTimeInfo(self, info):
self.pid = info['pid']
self.tid = info['tid']
self.objId = info['objId']
assert(self.rStartTime < self.rEndTime)
assert(self.rStartTime < self.kStartTime)
assert (self.rStartTime < self.rEndTime)
assert (self.rStartTime < self.kStartTime)

def setMarkerInfo(self, info):
self.layerMarkers, self.traceMarkers, self.reprMarkers, self.pyprofMarkers, self.seqMarkers, self.otherMarkers, self.altMarkers, self.seqId, self.altSeqId, self.layer = info
Expand Down
31 changes: 16 additions & 15 deletions pyprof/parse/nsight.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,22 @@ def getKernelInfo(self):
"""
Get GPU kernel info
"""
cmd = ("SELECT "
"demangledName as kNameId, "
"strings.value as name, "
"runtime.start as rStart, "
"runtime.end as rEnd, "
"runtime.globalTid as objId, "
"runtime.globalTid / 0x1000000 % 0x1000000 AS pid, "
"runtime.globalTid % 0x1000000 AS tid, "
"kernels.globalPid / 0x1000000 % 0x1000000 AS kpid, "
"kernels.correlationId,kernels.start,kernels.end,deviceId,streamId,"
"gridX,gridY,gridZ,blockX,blockY,blockZ "
"FROM {} AS kernels "
"JOIN {} AS strings ON (kNameId = strings.Id) "
"JOIN {} AS runtime ON (kernels.correlationId = runtime.correlationId AND kpid = pid) "
).format(self.kernelT, self.stringT, self.runtimeT)
cmd = (
"SELECT "
"demangledName as kNameId, "
"strings.value as name, "
"runtime.start as rStart, "
"runtime.end as rEnd, "
"runtime.globalTid as objId, "
"runtime.globalTid / 0x1000000 % 0x1000000 AS pid, "
"runtime.globalTid % 0x1000000 AS tid, "
"kernels.globalPid / 0x1000000 % 0x1000000 AS kpid, "
"kernels.correlationId,kernels.start,kernels.end,deviceId,streamId,"
"gridX,gridY,gridZ,blockX,blockY,blockZ "
"FROM {} AS kernels "
"JOIN {} AS strings ON (kNameId = strings.Id) "
"JOIN {} AS runtime ON (kernels.correlationId = runtime.correlationId AND kpid = pid) "
).format(self.kernelT, self.stringT, self.runtimeT)
result = self.db.select(cmd)
return result

Expand Down
28 changes: 15 additions & 13 deletions pyprof/parse/nvvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,21 @@ def getKernelInfo(self):
"""
Get GPU kernel info
"""
cmd = ("SELECT "
"name AS kNameId, "
"strings.value as name, "
"coalesce(runtime.start, driver.start) as rStart, "
"coalesce(runtime.end, driver.end) as rEnd, "
"coalesce(runtime.processId, driver.processId) as pid, "
"coalesce(runtime.threadId, driver.threadId) & 0xFFFFFFFF as tid, "
"kernels.correlationId,kernels.start,kernels.end,deviceId,streamId,"
"gridX,gridY,gridZ,blockX,blockY,blockZ "
"FROM {} AS kernels "
"JOIN {} AS strings ON (KNameId = strings._id_) "
"LEFT JOIN {} AS runtime ON (kernels.correlationId = runtime.correlationId) "
"LEFT JOIN {} AS driver ON (kernels.correlationId = driver.correlationId) ").format(self.kernelT, self.stringT, self.runtimeT, self.driverT)
cmd = (
"SELECT "
"name AS kNameId, "
"strings.value as name, "
"coalesce(runtime.start, driver.start) as rStart, "
"coalesce(runtime.end, driver.end) as rEnd, "
"coalesce(runtime.processId, driver.processId) as pid, "
"coalesce(runtime.threadId, driver.threadId) & 0xFFFFFFFF as tid, "
"kernels.correlationId,kernels.start,kernels.end,deviceId,streamId,"
"gridX,gridY,gridZ,blockX,blockY,blockZ "
"FROM {} AS kernels "
"JOIN {} AS strings ON (KNameId = strings._id_) "
"LEFT JOIN {} AS runtime ON (kernels.correlationId = runtime.correlationId) "
"LEFT JOIN {} AS driver ON (kernels.correlationId = driver.correlationId) "
).format(self.kernelT, self.stringT, self.runtimeT, self.driverT)
result = self.db.select(cmd)
return result

Expand Down
2 changes: 1 addition & 1 deletion pyprof/parse/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main():
#Get and set marker and seqid info
info = nvvp.getMarkerInfo(k.objId, k.rStartTime, k.rEndTime)
k.setMarkerInfo(info)

#If the seqId contains both 0 and non zero integers, remove 0.
if any(seq != 0 for seq in k.seqId) and (0 in k.seqId):
k.seqId.remove(0)
Expand Down

0 comments on commit 8f10ef8

Please sign in to comment.