diff --git a/pyprof/parse/kernel.py b/pyprof/parse/kernel.py index faba77f..670a005 100644 --- a/pyprof/parse/kernel.py +++ b/pyprof/parse/kernel.py @@ -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 diff --git a/pyprof/parse/nsight.py b/pyprof/parse/nsight.py index c298111..c2282d7 100644 --- a/pyprof/parse/nsight.py +++ b/pyprof/parse/nsight.py @@ -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 diff --git a/pyprof/parse/nvvp.py b/pyprof/parse/nvvp.py index 1b48940..6792b9b 100644 --- a/pyprof/parse/nvvp.py +++ b/pyprof/parse/nvvp.py @@ -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 diff --git a/pyprof/parse/parse.py b/pyprof/parse/parse.py index dcaf8a6..8a3f743 100755 --- a/pyprof/parse/parse.py +++ b/pyprof/parse/parse.py @@ -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)