【发布时间】:2016-10-30 19:25:36
【问题描述】:
在 OpenCL 世界中,有一个函数 clGetEventProfilingInfo 以纳秒为单位返回事件的所有分析信息,如排队、提交、开始和结束时间。这很方便,因为我可以随时printf 那个信息。
例如PyOpenCL 可以这样写代码
profile = event.profile
print("%gs + %gs" % (1e-9*(profile.end - profile.start), 1e-9*(profile.start - profile.queued)))
这对我的任务很有帮助。
【问题讨论】:
-
cudaEvent 系统可以通过
cudaEventElapsedTime为您提供相当于profile.end-profile.start的功能