You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def log_profile(self):
"""If we are in profiling mode, prints out all timing for every single OpenCL call
:param stats: if True, prints the statistics on each kernel instead of all execution timings
:return: list of lines to print
"""
total_time = 0.0
stats = {}
if self.profile:
for e in self.events:
if isinstance(e, ProfileDescription):
name = e[0]
t0 = e[1]
t1 = e[2]
elif isinstance(e, EventDescription) or "__len__" in dir(e) and len(e) == 2:
name = e[0]
pr = e[1].profile
t0 = pr.start
t1 = pr.end
else:
name = "?"
t0 = e.profile.start
t1 = e.profile.end
et = 1e-6 * (t1 - t0)
total_time += et
if name in stats:
stats[name].append(et)
else:
stats[name] = [et]
return stats
log_profile(gpu)
from silx.opencl.processing import EventDescription, ProfileDescription
log_profile(gpu)
stats = log_profile(gpu)
import matplotlib.cbook as cbook
list(stats.keys())
import numpy
ary = numpy.zeros((len(stats),max(len(i) for i in stats.values())))
ary.shape
for i,k in enumerate(stats):
ary[i] = stats[k]
import matplotlib.cbook as cbook
import matplotlib.pyplot as plt
fig, axs = plt.subplots()
axs.bxp(bstats[-1::-1], vert=False)
axs.set_xlabel("Runtime (ms)")
fig.suptitle("Runtime of different kernels Nvidia A5000")
fig.suptitle("Runtime of different kernels on Nvidia A5000")
axs.set_title("Average runtime timeit: 2.7ms, OpenCL: 2.2ms")
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: